aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2016-09-06 10:52:01 +0100
committerGitHub <noreply@github.com>2016-09-06 10:52:01 +0100
commit38fae35d53a029ee5b9c1192cb67ce2aa28f3904 (patch)
treea7a13a17095799f937114ed36658a5fcf5a0c5f2 /activerecord
parent495ef4124e292dcc7062e3e1f04f623053113101 (diff)
parent9a7409bb2807542226f4ba907c8386647e3c2fd1 (diff)
downloadrails-38fae35d53a029ee5b9c1192cb67ce2aa28f3904.tar.gz
rails-38fae35d53a029ee5b9c1192cb67ce2aa28f3904.tar.bz2
rails-38fae35d53a029ee5b9c1192cb67ce2aa28f3904.zip
Merge pull request #26394 from kamipo/remove_redundant_condition
Remove redundant `!loaded?` condition
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index d344277ab2..08bd532fb0 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -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