Displaying 1 result from an estimated 1 matches for "author_seri".
Did you mean:
author_series
2010 Aug 26
0
Eager loading a has_many :through (Rails3)
Hello all,
I''ve been trying out Rails 3 and can''t get past this issue:
I have a simple has_many :through:
class Author < ActiveRecord::Base
has_many :author_series
has_many :series, :through => :author_series
end
class Series < ActiveRecord::Base
has_many :author_series
has_many :authors, :through => :author_series
end
In my controller I would like to eager load all of the authors:
@series = Series.includes(:authors).all
This will eager...