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

Avoid duplicated conditionals

This commit is contained in:
Carlos Antonio da Silva 2014-03-14 10:41:02 -03:00
parent 3560d7aad7
commit 13cdb5fb49

View file

@ -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) }