#dup array_of_attributes a bit earlier - there's no point in duping the primary_key nulls we might put in next

master
Ben Woosley 2010-11-16 23:56:57 -08:00 committed by Zach Dennis
parent 899af1e412
commit 876546c584
1 changed files with 3 additions and 3 deletions

View File

@ -180,6 +180,9 @@ class ActiveRecord::Base
raise ArgumentError.new( "Invalid arguments!" )
end
# dup the passed in array so we don't modify it unintentionally
array_of_attributes = array_of_attributes.dup
# Force the primary key col into the insert if it's not
# on the list and we are using a sequence and stuff a nil
# value for it into each row so the sequencer will fire later
@ -188,9 +191,6 @@ class ActiveRecord::Base
array_of_attributes.each { |a| a << nil }
end
# dup the passed in array so we don't modify it unintentionally
array_of_attributes = array_of_attributes.dup
# record timestamps unless disabled in ActiveRecord::Base
if record_timestamps && options.delete( :timestamps )
add_special_rails_stamps column_names, array_of_attributes, options