aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJerad Phelps <jerad.phelps@gmail.com>2013-10-17 19:00:22 -0500
committerJerad Phelps <jerad.phelps@gmail.com>2013-10-27 08:50:35 -0500
commit26638f0ac939edb00d12b55442bbdb138d5d9449 (patch)
treedb4342624b74367631e79a0a2a83212aff9b6747 /activerecord/test
parent6c2810b8ed692004dca43e554982cdfdb8517b80 (diff)
downloadrails-26638f0ac939edb00d12b55442bbdb138d5d9449.tar.gz
rails-26638f0ac939edb00d12b55442bbdb138d5d9449.tar.bz2
rails-26638f0ac939edb00d12b55442bbdb138d5d9449.zip
added schema_migrations_table_name to ActiveRecord::Base in order that the name of the schema migrations table can be configured.
consolidated test_schema_migrations_table_name tests Added changelog entry edited changelog removed commented lines removed reader ensure the schema migrations table is reset at end of test added entry to configuration guide guides typo and changelog order
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/migration_test.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 931caff727..ed32d68530 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -311,14 +311,23 @@ class MigrationTest < ActiveRecord::TestCase
end
def test_schema_migrations_table_name
+ original_schema_migrations_table_name = ActiveRecord::Migrator.schema_migrations_table_name
+
+ assert_equal "schema_migrations", ActiveRecord::Migrator.schema_migrations_table_name
ActiveRecord::Base.table_name_prefix = "prefix_"
ActiveRecord::Base.table_name_suffix = "_suffix"
Reminder.reset_table_name
assert_equal "prefix_schema_migrations_suffix", ActiveRecord::Migrator.schema_migrations_table_name
+ ActiveRecord::Base.schema_migrations_table_name = "changed"
+ Reminder.reset_table_name
+ assert_equal "prefix_changed_suffix", ActiveRecord::Migrator.schema_migrations_table_name
ActiveRecord::Base.table_name_prefix = ""
ActiveRecord::Base.table_name_suffix = ""
Reminder.reset_table_name
- assert_equal "schema_migrations", ActiveRecord::Migrator.schema_migrations_table_name
+ assert_equal "changed", ActiveRecord::Migrator.schema_migrations_table_name
+ ensure
+ ActiveRecord::Base.schema_migrations_table_name = original_schema_migrations_table_name
+ Reminder.reset_table_name
end
def test_proper_table_name_on_migrator