diff options
author | utilum <oz@utilum.com> | 2018-04-04 11:05:07 +0200 |
---|---|---|
committer | utilum <oz@utilum.com> | 2018-04-04 11:05:14 +0200 |
commit | 73e9b854d87f52b1028636100ae8aecf45540fd0 (patch) | |
tree | 60009e6ded185fb23b7f920c7464cfe4ce0c2606 | |
parent | a07d0680787ced3c04b362fa7a238c918211ac70 (diff) | |
download | rails-73e9b854d87f52b1028636100ae8aecf45540fd0.tar.gz rails-73e9b854d87f52b1028636100ae8aecf45540fd0.tar.bz2 rails-73e9b854d87f52b1028636100ae8aecf45540fd0.zip |
passing splat keyword arguments as a single Hash
Ruby 2.6.0 warns about this.
-rw-r--r-- | actionview/lib/action_view/helpers/form_helper.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index afd49286e6..2d5c5684c1 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -1970,7 +1970,7 @@ module ActionView convert_to_legacy_options(options) - fields_for(scope || model, model, **options, &block) + fields_for(scope || model, model, options, &block) end # Returns a label tag tailored for labelling an input field for a specified attribute (identified by +method+) on an object 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 e2147b7fcf..ac73337aef 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -305,7 +305,8 @@ module ActiveRecord yield td if block_given? if options[:force] - drop_table(table_name, **options, if_exists: true) + drop_opts = { if_exists: true }.merge(**options) + drop_table(table_name, drop_opts) end result = execute schema_creation.accept td @@ -908,7 +909,7 @@ module ActiveRecord foreign_key_options = { to_table: reference_name } end foreign_key_options[:column] ||= "#{ref_name}_id" - remove_foreign_key(table_name, **foreign_key_options) + remove_foreign_key(table_name, foreign_key_options) end remove_column(table_name, "#{ref_name}_id") |