class Person < ActiveRecord::Base has_many :emails, :after_remove => :set_preferred_email
accepts_nested_attributes_for :emails, :allow_destroy => true
private def set_preferred_email # ... end end
person.emails.delete(email) # => it run the callback
person.update_attributes :emails_attributes => [{:id => email.id, :_delete => 1}] # => it doesn't run the callback
I created a patch and a LH ticket: #2146 AutosaveAssociation doesn't run removing association callbacks - Ruby on Rails - rails
Luca