I have a model that matches the following diagram:
class foo < ActiveRecord::Base
has_many :bar, :dependent => :destroy
has_many :baz, :through => :bar, :uniq => true,
:after_add => :update_baz_count,
:after_remove => :update_baz_count
def update_baz_count(record)
debugger
end
end
I am trying to maintain an account of a unique baz associated with foo through bar. But for some reason, subsequent after_add and after_remove callbacks are never called when I add a panel (which should have a baz) to foo. Any ideas why? I used these callbacks with habtm and they work great.
Thank.
source
share