Don't initialize options[:on_duplicate_key_update] if the adapter doesn't #supports_on_duplicate_key_update?
This commit is contained in:
parent
b3dda82c10
commit
fff00af942
|
@ -323,6 +323,7 @@ class ActiveRecord::Base
|
|||
array_of_attributes.each { |arr| arr << value }
|
||||
end
|
||||
|
||||
if supports_on_duplicate_key_update?
|
||||
if options[:on_duplicate_key_update]
|
||||
options[:on_duplicate_key_update] << key.to_sym if options[:on_duplicate_key_update].is_a?(Array)
|
||||
options[:on_duplicate_key_update][key.to_sym] = key.to_sym if options[:on_duplicate_key_update].is_a?(Hash)
|
||||
|
@ -332,6 +333,7 @@ class ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Returns an Array of Hashes for the passed in +column_names+ and +array_of_attributes+.
|
||||
def validations_array_for_column_names_and_attributes( column_names, array_of_attributes ) # :nodoc:
|
||||
|
|
Loading…
Reference in a new issue