More simplicity, once again with #map
This commit is contained in:
parent
3756e4f2b4
commit
18012bbbca
|
@ -165,15 +165,12 @@ class ActiveRecord::Base
|
||||||
column_names = self.column_names.dup
|
column_names = self.column_names.dup
|
||||||
end
|
end
|
||||||
|
|
||||||
array_of_attributes = []
|
array_of_attributes = models.map do |model|
|
||||||
models.each do |model|
|
|
||||||
# this next line breaks sqlite.so with a segmentation fault
|
# this next line breaks sqlite.so with a segmentation fault
|
||||||
# if model.new_record? || options[:on_duplicate_key_update]
|
# if model.new_record? || options[:on_duplicate_key_update]
|
||||||
attributes = []
|
column_names.map do |name|
|
||||||
column_names.each do |name|
|
model.send( "#{name}_before_type_cast" )
|
||||||
attributes << model.send( "#{name}_before_type_cast" )
|
|
||||||
end
|
end
|
||||||
array_of_attributes << attributes
|
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
# supports 2-element array and array
|
# supports 2-element array and array
|
||||||
|
|
Loading…
Reference in a new issue