Permalink
Browse files

Pulling attributes_from_column_definition should set the primary id t…

…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 ef489ca2ad9f3dd65563803a95d99cc53b2a5a0a
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/base.rb
@@ -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

0 comments on commit ef489ca

Please sign in to comment.