Skip to content

Commit

Permalink
Merge pull request #10572 from nertzy/dont-modify-options-hash-in-pri…
Browse files Browse the repository at this point in the history
…mary-key

Don't modify args in TableDefinition#primary_key
  • Loading branch information
rafaelfranca committed May 11, 2013
1 parent 057b159 commit 0215faf
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def columns; @columns_hash.values; end
# Appends a primary key definition to the table definition. # Appends a primary key definition to the table definition.
# Can be called multiple times, but this is probably not a good idea. # Can be called multiple times, but this is probably not a good idea.
def primary_key(name, type = :primary_key, options = {}) def primary_key(name, type = :primary_key, options = {})
options[:primary_key] = true column(name, type, options.merge(:primary_key => true))
column(name, type, options)
end end


# Returns a ColumnDefinition for the column with name +name+. # Returns a ColumnDefinition for the column with name +name+.
Expand Down

0 comments on commit 0215faf

Please sign in to comment.