Damn! I didn't see that one. Thanks Carlos.

On Friday, December 5, 2014 6:30:30 PM UTC-5, Carlos Antonio da Silva wrote:
>
> You should be able to use the *#added? 
> <http://api.rubyonrails.org/classes/ActiveModel/Errors.html#method-i-added-3F>*
>  method 
> for this.
>
> Hope that helps.
>
> On Fri, Dec 5, 2014 at 5:54 PM, Daniel Gomez Sierra <danielgo...@gmail.com 
> <javascript:>> wrote:
>
>> Is there a way to know if a record has an error with a certain attribute 
>> and error type after validating it? I was wondering if there is a way to 
>> accomplish this task by using something similar as the 
>> ActiveModel::Errors.get method but passing two arguments instead of one. 
>> For instance:
>>
>> ActiveModel::Errors.get(:user_id, :blank)       # =>  ["can't be blank"]
>>
>> If this is not implemented yet, I'd like to help with these changes. 
>> Thanks!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rubyonrails-co...@googlegroups.com <javascript:>.
>> To post to this group, send email to rubyonra...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/rubyonrails-core.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> At.
> Carlos Antonio
>  

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to