Skip to content

Commit

Permalink
More simplicity, once again with #map
Browse files Browse the repository at this point in the history
  • Loading branch information
Empact authored and zdennis committed Jan 11, 2011
1 parent 3756e4f commit 18012bb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/activerecord-import/import.rb
Expand Up @@ -165,15 +165,12 @@ def import( *args )
column_names = self.column_names.dup
end

array_of_attributes = []
models.each do |model|
array_of_attributes = models.map do |model|
# this next line breaks sqlite.so with a segmentation fault
# if model.new_record? || options[:on_duplicate_key_update]
attributes = []
column_names.each do |name|
attributes << model.send( "#{name}_before_type_cast" )
column_names.map do |name|
model.send( "#{name}_before_type_cast" )
end
array_of_attributes << attributes
# end
end
# supports 2-element array and array
Expand Down

0 comments on commit 18012bb

Please sign in to comment.