Forum: Ruby on Rails error HasManyThroughSourceAssociationNotFoundError

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
heri rakotomalala (Guest)
on 2006-05-16 01:42
(Received via mailing list)
hi there,

i have a problem with my code. it might be trivial but couldn t solve it
or
find it on google:

class Job < ActiveRecord::Base
 has_many :jobs_locations
 has_many :locations, :through => :jobs_locations
 has_many :jobs_skills
 has_many :skills, :through => :jobs_skills
end

class Skill < ActiveRecord::Base
 has_many :jobs_skills,
 has_many :jobs, :through => :jobs_skills
end
class Location < ActiveRecord::Base
 has_many :jobs_locations
 has_many :jobs, :through => :jobs_locations
end

now, when i have a job object and do job.locations, it always works
With job.skills, i have an error ?!?

ActiveRecord::HasManyThroughSourceAssociationNotFoundError

askill.jobs works though!

i don t understand why it works perfectly for locations and for
skill.jobsbut not for
job.skills (or actually something like Job.find(:all, :include =>
:skills,
:conditions ....). ??

if someone would solve it, it would be great. i have nearly finished
this
project and am looking forward to deploy it.
This topic is locked and can not be replied to.