Skip to content
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...
2 parents 5cdd0bc + 8d07f06 commit 24fb4dc1586dd95361e1b7f978f1c90c920e85c2 @rafaelfranca rafaelfranca committed May 11, 2013
3 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -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 24fb4dc

Please sign in to comment.
Something went wrong with that request. Please try again.