diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-28 10:43:18 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-28 10:43:18 -0700 |
commit | 2fc5c6333b64f01194abd45150c2891f7cc755fe (patch) | |
tree | 2e5b7abddbc1ab1e7d60bae10e3b4d4811ba9217 /activerecord | |
parent | e001ea09400af589ff629a895a1ae946c6d5ef69 (diff) | |
download | rails-2fc5c6333b64f01194abd45150c2891f7cc755fe.tar.gz rails-2fc5c6333b64f01194abd45150c2891f7cc755fe.tar.bz2 rails-2fc5c6333b64f01194abd45150c2891f7cc755fe.zip |
each works well too
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 5b2a202b73..c0cc7ba20d 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -361,7 +361,7 @@ module ActiveRecord 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) } * ',' |