Permalink
Browse files

no need for splat and flatten

  • Loading branch information...
1 parent 93096ae commit bf388f37ac056fbed95750a77efd5bc7d6ddb181 @tenderlove tenderlove committed Sep 28, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -360,7 +360,7 @@ def copy_table_indexes(from, to, rename = {}) #:nodoc:
end
def copy_table_contents(from, to, columns, rename = {}) #:nodoc:
- column_mappings = Hash[*columns.map {|name| [name, name]}.flatten]
+ column_mappings = Hash[columns.map {|name| [name, name]}]
rename.inject(column_mappings) {|map, a| map[a.last] = a.first; map}
from_columns = columns(from).collect {|col| col.name}
columns = columns.find_all{|col| from_columns.include?(column_mappings[col])}

0 comments on commit bf388f3

Please sign in to comment.