I have the @user variable, and i have resources table, and then I have a favorites table which is merely user_id and resource_id
@user.resources.each works obviously
@user.favorites.first.resource works fine, except i want all of the resources.
@user.favorites.resources does not work
resource.rb
belongs_to :category
belongs_to :user
has_many :favorites
has_many :resource_tags
has_many :tags, :through => :resource_tags
user.rb
has_many :resources
has_many :favorites
favorite.rb
belongs_to :resource
belongs_to :user
Try:
That should eager load the resource from all the User’s favorites and then the collect should return them as an Array.