Hi
I’ve come across a behavior which doesn’t seem to be consistent. Let’s
assume the following models:
class Client << ActiveRecord::Base
has_many :resale_clients, :foreign_key => ‘reseller_id’
end
class ResaleClient << Client
belongs_to :client, :foreign_key => ‘reseller_id’
after_save :ack
def ack
puts “triggered”
end
end
Now in the console (assuming two Client records exist in the db):
c = Client.first
r = ResaleClient.find(2)
c.resale_clients << r # outputs “triggered”
c.resale_clients.delete® # does not output “triggered”
Any idea what I’m doing wrong here?
Many thanks!!