Rails 2.3.8. I have 3 models: user, source and subscription.
User attr_accessible :source_ids
has_many :subscriptions
has_many :sources, :through => :subscriptions
Source has_many :subscriptions
Subscription belongs_to :user
belongs_to :source
I have an interface that allows the user to edit their Subscriptions to the Source. It collects source_ids and creates or deletes a subscription based on the collection. The problem I ran into is the quote:
"Automatic removal of join models is direct, no destroy callbacks are triggered."
Subscriptions are deleted, not destroyed. I have a callback in a Subscription model that does not start:
before_destroy do |subscription|
[Some irrelevant object not to be mentioned].destroy
end
My question is, how can I call this callback when the subscription is automatically deleted due to the connection model?