Renamed #values_sql_for_column_names_and_attributes to #values_sql_for_columns_and_attributes and cleaned up how it dealt with columns.
* added back in the support for type-casting based on the database column * removed unused method in ActiveRecord::Import::AbstractAdapter https://github.com/zdennis/activerecord-import/issues#issue/5
This commit is contained in:
parent
1a8082444b
commit
161cf017f9
2 changed files with 5 additions and 17 deletions
|
@ -116,17 +116,6 @@ module ActiveRecord::Import::AbstractAdapter
|
|||
post_sql_statements
|
||||
end
|
||||
|
||||
# Returns SQL the VALUES for an INSERT statement given the passed in +columns+
|
||||
# and +array_of_attributes+.
|
||||
def values_sql_for_column_names_and_attributes( columns, array_of_attributes ) # :nodoc:
|
||||
array_of_attributes.map do |arr|
|
||||
my_values = arr.each_with_index.map do |val,j|
|
||||
quote( columns[j].type_cast(val), columns[j] )
|
||||
end
|
||||
"(#{my_values.join(',')})"
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the maximum number of bytes that the server will allow
|
||||
# in a single packet
|
||||
def max_allowed_packet
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue