1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #26394 from kamipo/remove_redundant_condition

Remove redundant `!loaded?` condition
This commit is contained in:
Andrew White 2016-09-06 10:52:01 +01:00 committed by GitHub
commit 38fae35d53

View file

@ -227,9 +227,9 @@ module ActiveRecord
else
target.size
end
elsif !loaded? && !association_scope.group_values.empty?
elsif !association_scope.group_values.empty?
load_target.size
elsif !loaded? && !association_scope.distinct_value && target.is_a?(Array)
elsif !association_scope.distinct_value && target.is_a?(Array)
unsaved_records = target.select(&:new_record?)
unsaved_records.size + count_records
else