Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb
- index a28be9e..9c44eb9 100644
- --- a/activerecord/lib/active_record/associations/association_collection.rb
- +++ b/activerecord/lib/active_record/associations/association_collection.rb
- @@ -206,7 +206,11 @@ module ActiveRecord
- end
- def empty?
- - size.zero?
- + if loaded? || @reflection.options[:counter_sql]
- + size.zero?
- + else
- + !exists?({})
- + end
- end
- def any?
- diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb
- index d5a1c5f..ab842b4 100644
- --- a/activerecord/lib/active_record/named_scope.rb
- +++ b/activerecord/lib/active_record/named_scope.rb
- @@ -137,7 +137,7 @@ module ActiveRecord
- end
- def empty?
- - @found ? @found.empty? : count.zero?
- + @found ? @found.empty? : !exists?({})
- end
- def any?
Add Comment
Please, Sign In to add comment