As stated in the documentation 
<http://guides.rubyonrails.org/association_basics.html#association-callbacks>: 
*If a before_add callback throws an exception, the object does not get 
added to the collection*

This way to prevent that save is very "ugly".
It would be better to keep the standard of the other callback (like 
before_create): if it returns false, not saved.
Others users would also like it that way 
<http://stackoverflow.com/questions/7273792/silently-skip-add-with-before-add-association-callback-instead-of-raising-an-exc>
.

-- 
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 [email protected].
To post to this group, send email to [email protected].
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