Displaying 1 result from an estimated 1 matches for "daynotes".
Did you mean:
daynote
2006 Oct 08
1
Two-way eager loading?
...the eager loading isn''t
working as well as I would hope...
Here are my two classes:
class Daynote < ActiveRecord::Base
belongs_to :userplace
class Userplace < ActiveRecord::Base
has_many :daynote, :dependent => true
When I show my userplaces, I want to get the associated daynotes with
them, so I am doing:
@userplace = Userplace.find(params[:id],:include => :daynote)
What I''m seeing is that @userplace.daynote uses the array of objects
from the eager load. That''s what I want, since it cuts out a lot of
queries. But then if I pass the daynote objec...