Skip to content

Commit

Permalink
Pulling attributes_from_column_definition should set the primary id t…
Browse files Browse the repository at this point in the history
…o nil instead of not at all

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@232 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Dec 19, 2004
1 parent 2f26785 commit ef489ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ def interpolate_sql(sql, record = nil)
# 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
Expand Down

0 comments on commit ef489ca

Please sign in to comment.