From c827b3f15cdf66da1d09eff5ad4878098933c7d6 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 1 Nov 2005 18:21:46 +0000 Subject: A missing primary key column shouldn't raise an error when generating its error message. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2837 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index d408173c01..0d9b1d4f7b 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1139,7 +1139,7 @@ module ActiveRecord #:nodoc: def id attr_name = self.class.primary_key column = column_for_attribute(attr_name) - raise ActiveRecordError, "No such primary key column #{attr_name} for table #{table_name}" if column.nil? + raise ActiveRecordError, "No such primary key column #{attr_name} for table #{self.class.table_name}" if column.nil? define_read_method(:id, attr_name, column) if self.class.generate_read_methods (value = @attributes[attr_name]) && column.type_cast(value) end -- cgit v1.2.3