Skip to content

Commit

Permalink
Unify add_column method definition with other ones that take keywor…
Browse files Browse the repository at this point in the history
…d arguments
  • Loading branch information
amatsuda committed Sep 11, 2019
1 parent 3796cd6 commit 70afbf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def drop_foreign_key(name)
@foreign_key_drops << name
end

def add_column(name, type, options)
def add_column(name, type, **options)
name = name.to_s
type = type.to_sym
@adds << AddColumnDefinition.new(@td.new_column_definition(name, type, **options))
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/migration/compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def create_join_table(table_1, table_2, column_options: {}, **options)
super
end

def add_column(table_name, column_name, type, options = {})
def add_column(table_name, column_name, type, **options)
if type == :primary_key
type = :integer
options[:primary_key] = true
Expand Down

0 comments on commit 70afbf2

Please sign in to comment.