diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 3 |
1 files changed, 2 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 1c93a9a2d1..2b78c300f5 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -285,7 +285,8 @@ module ActiveRecord def copy_table(from, to, options = {}) #:nodoc: options = options.merge(:id => !columns(from).detect{|c| c.name == 'id'}.nil?) - create_table(to, options) do |@definition| + create_table(to, options) do |definition| + @definition = definition columns(from).each do |column| column_name = options[:rename] ? (options[:rename][column.name] || |