Hi all, I found a strange behaviour in eager loading: class Category < ActiveRecord::Base has_and_belongs_to_many :movies has_and_belongs_to_many :most_recent_movies, :class_name => 'Movie', :order => 'created_at DESC', :limit => 10 end class Movie < ActiveRecord::Base has_and_belongs_to_many :categories end Category.find(1).most_recent_movies # => returns 10 movies Category.find(1, :include => :most_recent_movies).most_recent_movies # => returns all the associated movies I fixed it, you can find the patch at: http://rails.lighthouseapp.com/projects/8994-ruby-... Best, Luca -- blog: www.lucaguidi.com Pro-Netics: www.pro-netics.com Sourcesense - making sense of Open Source: www.sourcesense.com
on 2008-06-28 11:49