I have join model being used with the has_many :through relationship
and am doing the following…
has_many :candidates_viewd, :through => :views, :source
has_many :jobs_viewd, :through => :views, :source => :job
user = Candidate.find(1)
job = user.jobs_viewed.first
When I was using has_and_belongs_to I could use the .delete(object)
method and the record in the join table would be deleted. Now
has_many :through delete(object) just NULLifies the foreign key.
Is there a simple way around this or am I going to have to write
custom methods to delete the specific join model record?
BTW, for all the raving I’ve heard about has_many :through it seems to
be much more work and less freedom than has_and_belongs_to (I was
using push_with_attributes and that is being deprecated)