diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 07:33:53 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 07:33:53 +0000 |
commit | 660a696a3f5f20ccd12faaf5a989b1ace34c447b (patch) | |
tree | ee7014ea6b51d74b5af5ea71ab098e1e347ab2ae /activerecord | |
parent | 9f5a9aa35f1fa252a99498dc464677c968e694ba (diff) | |
download | rails-660a696a3f5f20ccd12faaf5a989b1ace34c447b.tar.gz rails-660a696a3f5f20ccd12faaf5a989b1ace34c447b.tar.bz2 rails-660a696a3f5f20ccd12faaf5a989b1ace34c447b.zip |
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
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/migration_test.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb index 13c9dc692a..4e778af336 100644 --- a/activerecord/test/migration_test.rb +++ b/activerecord/test/migration_test.rb @@ -548,7 +548,19 @@ if ActiveRecord::Base.connection.supports_migrations? 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 |