Hi everybody and especially Pat.

I have the following models:

class Restaurant < ActiveRecord::Base
  belongs_to :franchise
  define_index...
end
class Franchise < ActiveRecord::Base
  has_many :restaurants
  has_many :menus
end
class Menu < ActiveRecord::Base
  belongs_to :franchise
end

And i setup the sphinx index on my restaurant model.  When i search:
Restaurant.search('food', :include => [:franchise])
chains are eager loaded as expected.

But is there a way to eager load menus as well?  I tried the normal
rails convention of eager loading nested associations, but that didn't
work
Doesnt Work ## Restaurant.search('food', :include => [ { :franchise
=> :menus }])

Can it be done and how? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" 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/thinking-sphinx?hl=en.

Reply via email to