Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test that change_column quotes column names. Closes #9537 [lawrence]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 660a696a3f5f20ccd12faaf5a989b1ace34c447b 1 parent 9f5a9aa
@jeremy jeremy authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 activerecord/test/migration_test.rb
View
14 activerecord/test/migration_test.rb
@@ -548,7 +548,19 @@ def test_change_column_default
Person.reset_column_information
assert_equal "Tester", Person.new.first_name
end
-
+
+ def test_change_column_quotes_column_names
+ Person.connection.create_table :testings do |t|
+ t.column :select, :string
+ end
+
+ assert_nothing_raised { Person.connection.change_column :testings, :select, :string, :limit => 10 }
+
+ assert_nothing_raised { Person.connection.execute "insert into testings (#{Person.connection.quote_column_name('select')}) values ('7 chars')" }
+ ensure
+ Person.connection.drop_table :testings rescue nil
+ end
+
def test_change_column_default_to_null
Person.connection.change_column_default "people", "first_name", nil
Person.reset_column_information
Please sign in to comment.
Something went wrong with that request. Please try again.