I am having some difficulties with ActiveRecord.
What I want to do is to get a collection of SubjectGroups for using
class Subject < ActiveRecord::Base
class SubjectGroup < ActiveRecord::Base
@subjects= Subject.find(:all, :include => :subject_group)
@groups= SubjectGroup.find(:all, :include => :subjects)
The first find instruction runs just fine, the second gives me the
You have a nil object when you didn’t expect it!, The error occurred
while evaluating nil.loaded
I was expecting a SubjectGroup collection with all Subjects associated.
In both cases I saw the generated queries through logs and returns the
same query result.
Thank you for your attention,