Forum: Ruby on Rails error HasManyThroughSourceAssociationNotFoundError

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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
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

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

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

ActiveRecord::HasManyThroughSourceAssociationNotFoundError 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 =>
:conditions ....). ??

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