Merge pull request #10572 from nertzy/dont-modify-options-hash-in-primary-key

Don't modify args in TableDefinition#primary_key
This commit is contained in:
Rafael Mendonça França 2013-05-11 12:47:31 -07:00
parent 057b159a7b
commit 0215faf472

@ -65,8 +65,7 @@ def columns; @columns_hash.values; end
# Appends a primary key definition to the table definition.
# Can be called multiple times, but this is probably not a good idea.
def primary_key(name, type = :primary_key, options = {})
options[:primary_key] = true
column(name, type, options)
column(name, type, options.merge(:primary_key => true))
end
# Returns a ColumnDefinition for the column with name +name+.