diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-23 10:59:30 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-23 11:09:48 -0700 |
commit | 05dd3df35db8b2d39ed177f4ccfe112bdfe7726d (patch) | |
tree | e4956819b7267254015ccbb367307e527231dff5 /activerecord/test/cases/base_test.rb | |
parent | b318758bda9f9ea9c94abb81e8a66a8b48cb720c (diff) | |
download | rails-05dd3df35db8b2d39ed177f4ccfe112bdfe7726d.tar.gz rails-05dd3df35db8b2d39ed177f4ccfe112bdfe7726d.tar.bz2 rails-05dd3df35db8b2d39ed177f4ccfe112bdfe7726d.zip |
Remove `Column#primary`
It appears to have been used at some point in the past, but is no longer
used in any meaningful way. Whether a column is considered primary is
a property of the model, not the schema/column. This also removes the
need for yet another layer of caching of the model's schema, and we can
leave that to the schema cache.
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 7c7c1fbfbd..c565daba65 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -102,8 +102,8 @@ class BasicsTest < ActiveRecord::TestCase end def test_columns_should_obey_set_primary_key - pk = Subscriber.columns.find { |x| x.name == 'nick' } - assert pk.primary, 'nick should be primary key' + pk = Subscriber.columns_hash[Subscriber.primary_key] + assert_equal 'nick', pk.name, 'nick should be primary key' end def test_primary_key_with_no_id |