Hi,
I am trying eager loading with has_many through association. But i get
a could not find id error (detaiLs on error below) .
Models
Presenceship
belongs_to :person
belongs_to :contactoccasion
Person
has_many :presenceships
has_many :contactoccasions through :presenceships
has_many relations
#MOre person assocaitions here
…
Contactoccasions
has_many :presenceships
has_many :people through :presenceships
Now when i try the statement
Person.find(:all, :conditions[…some
condition.],:include=>[:relations,{:presenceships=>:contactoccasion})
i get an SQL error could not find id. I checked the development log and
found this:
…presenceships.[id] AS t5_r0, presenceships.[contactoccasion_id] AS
t5_r1, presenceships.[person_id] AS t5_r2, contactoccasions.[id] AS
t6_r0, …
i cannot understand why it tried to get presenceships.id
As it is a join association model it has no id column
Can anyone please tell me what is wrong???
Thank you.