As per 
http://rails.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html

  Possible callbacks are: before_add, after_add, before_remove and
after_remove.
  Should any of the before_add callbacks throw an exception, the
object does not get added to the collection. Same with the
before_remove callbacks; if an exception is thrown the object doesn‘t
get removed.

However, when the add fails due to a before_add violation, the
exception thrown just blows up the whole stack. It doesn't get caught
and turned into a Validation error on the object.

Is there a standard pattern for handling this?

Thanks,

-cpr

-- 
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.

Reply via email to