Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid duplicated conditionals

  • Loading branch information...
commit 13cdb5fb49e08945855bd7196d5520cf2a885c5c 1 parent 3560d7a
@carlosantoniodasilva carlosantoniodasilva authored
View
3  activerecord/lib/active_record/associations/collection_association.rb
@@ -145,9 +145,8 @@ def create!(attributes = {}, &block)
# 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) }
Please sign in to comment.
Something went wrong with that request. Please try again.