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
This commit is contained in:
David Heinemeier Hansson
2004-12-19 23:11:06 +00:00
parent 2f26785425
commit ef489ca2ad

View File

@@ -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