Permalink
Browse files

each works well too

  • Loading branch information...
1 parent bf388f3 commit ede0466d13a04a9ee609e09a54ae55c06228875c @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
@@ -361,7 +361,7 @@ def copy_table_indexes(from, to, rename = {}) #:nodoc:
def copy_table_contents(from, to, columns, rename = {}) #:nodoc:
column_mappings = Hash[columns.map {|name| [name, name]}]
- rename.inject(column_mappings) {|map, a| map[a.last] = a.first; map}
+ rename.each { |a| column_mappings[a.last] = a.first }
from_columns = columns(from).collect {|col| col.name}
columns = columns.find_all{|col| from_columns.include?(column_mappings[col])}
quoted_columns = columns.map { |col| quote_column_name(col) } * ','

0 comments on commit ede0466

Please sign in to comment.