Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test refactor, don't hardcode `primary_key_prefix_type` default.

/cc @zuhao
  • Loading branch information...
commit 89845ff86654274f183645c451b07233c18f67f7 1 parent 69274ce
Yves Senn senny authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  activerecord/test/cases/primary_keys_test.rb
3  activerecord/test/cases/primary_keys_test.rb
View
@@ -92,6 +92,7 @@ def test_find_with_more_than_one_string_key
end
def test_primary_key_prefix
+ old_primary_key_prefix_type = ActiveRecord::Base.primary_key_prefix_type
ActiveRecord::Base.primary_key_prefix_type = :table_name
Topic.reset_primary_key
assert_equal "topicid", Topic.primary_key
@@ -103,6 +104,8 @@ def test_primary_key_prefix
ActiveRecord::Base.primary_key_prefix_type = nil
Topic.reset_primary_key
assert_equal "id", Topic.primary_key
+ ensure
+ ActiveRecord::Base.primary_key_prefix_type = old_primary_key_prefix_type
end
def test_delete_should_quote_pkey

1 comment on commit 89845ff

Zuhao Wan

:+1: Thanks @senny !

Please sign in to comment.
Something went wrong with that request. Please try again.