diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-01-24 20:57:11 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-01-30 11:56:41 +0000 |
commit | aa86420be24d7df9c07379bcf6f33904d0d41adc (patch) | |
tree | 1ca85cc227bafdeda80e2ed234d26cbe2fa21ce5 /activerecord/lib/active_record/associations/has_many_association.rb | |
parent | de05e2fb15ee4fd521aae202eb4517ae05114c28 (diff) | |
download | rails-aa86420be24d7df9c07379bcf6f33904d0d41adc.tar.gz rails-aa86420be24d7df9c07379bcf6f33904d0d41adc.tar.bz2 rails-aa86420be24d7df9c07379bcf6f33904d0d41adc.zip |
Rename AssociationProxy#loaded to loaded! as it mutates the association
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb index 002e1a9ae8..caefd14ee3 100644 --- a/activerecord/lib/active_record/associations/has_many_association.rb +++ b/activerecord/lib/active_record/associations/has_many_association.rb @@ -40,7 +40,7 @@ module ActiveRecord # If there's nothing in the database and @target has no new records # we are certain the current target is an empty array. This is a # documented side-effect of the method that may avoid an extra SELECT. - @target ||= [] and loaded if count == 0 + @target ||= [] and loaded! if count == 0 [@reflection.options[:limit], count].compact.min end |