diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-11-02 18:13:54 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-11-02 18:13:54 +0530 |
commit | dc37fdc48095567ccd4d8bd19a7ded7ac773dcda (patch) | |
tree | 45a3e66e3bc7f61dcf57efc550173213e2bac8ec /activerecord/lib/active_record | |
parent | 8a53e258e541ede706a30ece80d89b3097efb686 (diff) | |
download | rails-dc37fdc48095567ccd4d8bd19a7ded7ac773dcda.tar.gz rails-dc37fdc48095567ccd4d8bd19a7ded7ac773dcda.tar.bz2 rails-dc37fdc48095567ccd4d8bd19a7ded7ac773dcda.zip |
Merge docrails. Remove unnecessary files.
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 84caca3518..c7cb6eb966 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -507,6 +507,14 @@ module ActiveRecord # # will load posts and eager load the +approved_comments+ association, which contains only those comments that have been approved. # + # If you eager load an association with a specified <tt>:limit</tt> option, it will be ignored, returning all the associated objects: + # + # class Picture < ActiveRecord::Base + # has_many :most_recent_comments, :class_name => 'Comment', :order => 'id DESC', :limit => 10 + # end + # + # Picture.find(:first, :include => :most_recent_comments).most_recent_comments # => returns all associated comments. + # # When eager loaded, conditions are interpolated in the context of the model class, not the model instance. Conditions are lazily interpolated # before the actual model exists. # |