mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user