From 046a87a85553173d02c2f349e05282235cea58a4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 22 Sep 2007 18:23:30 +0000 Subject: Fixed rename_column for SQLite when using symbols for the column names (closes #8616) [drodriguez] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 62d7e5364c..1c93a9a2d1 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -238,12 +238,13 @@ module ActiveRecord self.type = type self.limit = options[:limit] if options.include?(:limit) self.default = options[:default] if include_default + self.null = options[:null] if options.include?(:null) end end end def rename_column(table_name, column_name, new_column_name) #:nodoc: - alter_table(table_name, :rename => {column_name => new_column_name}) + alter_table(table_name, :rename => {column_name.to_s => new_column_name.to_s}) end @@ -290,7 +291,7 @@ module ActiveRecord (options[:rename][column.name] || options[:rename][column.name.to_sym] || column.name) : column.name - + @definition.column(column_name, column.type, :limit => column.limit, :default => column.default, :null => column.null) -- cgit v1.2.3