Well, it seems that obj.valid? and obj.save remove all manually added
errors?!
@comment.errors.add_to_base("Captcha wurde nicht korrekt
eingegeben")
raise "valid? #[email protected]?} - errors:
#[email protected]}"
results in "valid? false - errors: #<ActiveRecord::Errors:0x23d028c
@base=#<Comment id: nil, commentable_id: 38313, user_id: 1, subject: "",
body: "", created_at: nil, updated_at: nil, commentable_type:
"Article">, @errors={"body"=>["can't be blank"], "subject"=>["can't be
blank"]}>"
and
raise "errors: #[email protected]}"
results in "errors: #<ActiveRecord::Errors:0x1878538 @base=#<Comment id:
nil, commentable_id: 38313, user_id: 1, subject: "", body: "",
created_at: nil, updated_at: nil, commentable_type: "Article">,
@errors={"base"=>["Captcha wurde nicht korrekt eingegeben"]}>"
Why the heck does ActiveRecord remove my custom errors when calling
.valid???
Thanks a lot for help
Josh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---