From ef489ca2ad9f3dd65563803a95d99cc53b2a5a0a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 19 Dec 2004 23:11:06 +0000 Subject: Pulling attributes_from_column_definition should set the primary id to nil instead of not at all git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@232 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 0f07af2d09..8f011947b3 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1047,7 +1047,7 @@ module ActiveRecord #:nodoc: # that instances loaded from the database would. def attributes_from_column_definition connection.columns(self.class.table_name, "#{self.class.name} Columns").inject({}) do |attributes, column| - attributes[column.name] = column.default unless column.name == self.class.primary_key + attributes[column.name] = (column.default unless column.name == self.class.primary_key) attributes end end -- cgit v1.2.3