diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-21 17:41:39 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-21 17:41:39 +0900 |
commit | b57ca840a6fe64b7a76bc6585dff26e5c08879fb (patch) | |
tree | c7a925bb2cb66be1d2e5d82f1fa7251797c27790 /activerecord/lib | |
parent | 6cb176cddfc1541da20da4e75b472c3405f6c933 (diff) | |
download | rails-b57ca840a6fe64b7a76bc6585dff26e5c08879fb.tar.gz rails-b57ca840a6fe64b7a76bc6585dff26e5c08879fb.tar.bz2 rails-b57ca840a6fe64b7a76bc6585dff26e5c08879fb.zip |
Address "warning: in `column': the last argument was passed as a single Hash"
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index a27751fd70..11d4b4a503 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -208,7 +208,7 @@ module ActiveRecord ## # :method: column - # :call-seq: column(name, type, options = {}) + # :call-seq: column(name, type, **options) # # Appends a column or columns of a specified type. # @@ -364,7 +364,7 @@ module ActiveRecord # t.references :tagger, polymorphic: true # t.references :taggable, polymorphic: { default: 'Photo' }, index: false # end - def column(name, type, options = {}) + def column(name, type, **options) name = name.to_s type = type.to_sym if type options = options.dup @@ -541,7 +541,7 @@ module ActiveRecord # t.column(:name, :string) # # See TableDefinition#column for details of the options you can use. - def column(column_name, type, options = {}) + def column(column_name, type, **options) index_options = options.delete(:index) @base.add_column(name, column_name, type, options) index(column_name, index_options.is_a?(Hash) ? index_options : {}) if index_options diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 78e153bcc9..b202a82f55 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -584,7 +584,7 @@ module ActiveRecord # # Defines a column with a database-specific type. # add_column(:shapes, :triangle, 'polygon') # # ALTER TABLE "shapes" ADD "triangle" polygon - def add_column(table_name, column_name, type, options = {}) + def add_column(table_name, column_name, type, **options) at = create_alter_table table_name at.add_column(column_name, type, options) execute schema_creation.accept at |