Inline multiple_value_sets_insert_sql because it never changes, isn't particularly well-factored, and for parity with "not supports_import?"

This commit is contained in:
Ben Woosley 2010-11-16 23:14:28 -08:00 committed by Zach Dennis
parent 2ada56f858
commit 7aefcf1164
2 changed files with 1 additions and 7 deletions

View file

@ -116,12 +116,6 @@ module ActiveRecord::Import::AbstractAdapter
post_sql_statements post_sql_statements
end end
# Generates the INSERT statement used in insert multiple value sets.
def multiple_value_sets_insert_sql(table_name, column_names, options) # :nodoc:
"INSERT #{options[:ignore] ? 'IGNORE ':''}INTO #{table_name} (#{column_names.join(',')}) VALUES "
end
# Returns SQL the VALUES for an INSERT statement given the passed in +columns+ # Returns SQL the VALUES for an INSERT statement given the passed in +columns+
# and +array_of_attributes+. # and +array_of_attributes+.
def values_sql_for_column_names_and_attributes( columns, array_of_attributes ) # :nodoc: def values_sql_for_column_names_and_attributes( columns, array_of_attributes ) # :nodoc:

View file

@ -277,7 +277,7 @@ class ActiveRecord::Base
end end
else else
# generate the sql # generate the sql
insert_sql = connection.multiple_value_sets_insert_sql( quoted_table_name, escaped_column_names, options ) insert_sql = "INSERT #{options[:ignore] ? 'IGNORE ':''}INTO #{quoted_table_name} (#{escaped_column_names.join(',')}) VALUES "
values_sql = connection.values_sql_for_column_names_and_attributes( columns, array_of_attributes ) values_sql = connection.values_sql_for_column_names_and_attributes( columns, array_of_attributes )
post_sql_statements = connection.post_sql_statements( quoted_table_name, options ) post_sql_statements = connection.post_sql_statements( quoted_table_name, options )