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:
parent
3560d7aad7
commit
13cdb5fb49
1 changed files with 1 additions and 2 deletions
|
@ -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) }
|
||||
|
|
Loading…
Reference in a new issue