Browse files

Merge pull request #10572 from nertzy/dont-modify-options-hash-in-pri…


Don't modify args in TableDefinition#primary_key
  • Loading branch information...
1 parent 057b159 commit 0215faf472aa22a0e57147cc529fe91ee3117926 @rafaelfranca rafaelfranca committed May 11, 2013
@@ -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))
# Returns a ColumnDefinition for the column with name +name+.

0 comments on commit 0215faf

Please sign in to comment.