Skip to content

Commit

Permalink
test refactor, don't hardcode default for table_name_prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
senny committed Jun 6, 2014
1 parent 89845ff commit d23cbbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion activerecord/test/cases/ar_schema_test.rb
Expand Up @@ -34,6 +34,7 @@ def test_schema_define


def test_schema_define_w_table_name_prefix def test_schema_define_w_table_name_prefix
table_name = ActiveRecord::SchemaMigration.table_name table_name = ActiveRecord::SchemaMigration.table_name
old_table_name_prefix = ActiveRecord::Base.table_name_prefix
ActiveRecord::Base.table_name_prefix = "nep_" ActiveRecord::Base.table_name_prefix = "nep_"
ActiveRecord::SchemaMigration.table_name = "nep_#{table_name}" ActiveRecord::SchemaMigration.table_name = "nep_#{table_name}"
ActiveRecord::Schema.define(:version => 7) do ActiveRecord::Schema.define(:version => 7) do
Expand All @@ -46,7 +47,7 @@ def test_schema_define_w_table_name_prefix
end end
assert_equal 7, ActiveRecord::Migrator::current_version assert_equal 7, ActiveRecord::Migrator::current_version
ensure ensure
ActiveRecord::Base.table_name_prefix = "" ActiveRecord::Base.table_name_prefix = old_table_name_prefix
ActiveRecord::SchemaMigration.table_name = table_name ActiveRecord::SchemaMigration.table_name = table_name
end end


Expand Down

0 comments on commit d23cbbb

Please sign in to comment.