diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-01-12 15:05:07 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-01-13 00:20:38 +0100 |
commit | ec07735641e4df13b644a85f1f300cf20134995a (patch) | |
tree | 5540e6545472ef3a4916f6915bb957530d7835a4 /activerecord/lib | |
parent | 6581d798e830a7820dd54fe95d40014c0e2057fe (diff) | |
download | rails-ec07735641e4df13b644a85f1f300cf20134995a.tar.gz rails-ec07735641e4df13b644a85f1f300cf20134995a.tar.bz2 rails-ec07735641e4df13b644a85f1f300cf20134995a.zip |
`CollectionAssociation#empty?` respects newly builded records
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 832b963052..5feb149946 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -273,7 +273,7 @@ module ActiveRecord if loaded? || options[:counter_sql] size.zero? else - !scope.exists? + @target.blank? && !scope.exists? end end |