From 13cdb5fb49e08945855bd7196d5520cf2a885c5c Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 14 Mar 2014 10:41:02 -0300 Subject: [PATCH] Avoid duplicated conditionals --- .../lib/active_record/associations/collection_association.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index ff0fbe932b..1f314e0677 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -145,9 +145,8 @@ module ActiveRecord # be chained. Since << flattens its argument list and inserts each record, # +push+ and +concat+ behave identically. def concat(*records) - load_target if owner.new_record? - if owner.new_record? + load_target concat_records(records) else transaction { concat_records(records) }