Hello all

I've encountered a weird difficulty...I wonder what am I doing wrong..

I have three models:
User,Assignment,Idea
The User has many assignments and each assignments belongs to Idea.
I have also defined has many through relations on User (ideas) and on
Idea (users) -- through assignments...

The database is populated with the needed data..

I am using this to query the models..
@out = User.joins(:ideas,:assignments =>
[:user,:idea]).includes(:ideas,:assignments => [:user,:idea]).find(1)


The result contains a User object with ideas array (has_many) with one
Idea object but its empty (all attributes are nil)...  It also
contains an assignments array  (has_many) with one Assignment object
but the reference to the Idea (belongs_to) is null.. (user_id,idea_id
do exist and have correct value)
It is like the join is not performed..

BTW- The console shows that the JOIN is performed.

What is wrong?

Thanks in advance
Afik





-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to