From 05dd3df35db8b2d39ed177f4ccfe112bdfe7726d Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Fri, 23 May 2014 10:59:30 -0700 Subject: 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. --- activerecord/test/cases/base_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test/cases/base_test.rb') 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 -- cgit v1.2.3