From 3796cd628f8907b0471172b9cf7e5480e060a4c3 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 11 Sep 2019 08:45:09 +0900 Subject: [PATCH] Fix keyword arguments warnings --- .../active_record/connection_adapters/abstract_mysql_adapter.rb | 2 +- activerecord/lib/active_record/validations/associated.rb | 2 +- activerecord/test/cases/autosave_association_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index e457913bea..2609df2457 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -783,7 +783,7 @@ module ActiveRecord options[:primary_key_column] = column_for(match[:target_table], match[:primary_key]) end - MismatchedForeignKey.new(options) + MismatchedForeignKey.new(**options) end def version_string(full_version_string) diff --git a/activerecord/lib/active_record/validations/associated.rb b/activerecord/lib/active_record/validations/associated.rb index dc89df4be7..2112a6d7b6 100644 --- a/activerecord/lib/active_record/validations/associated.rb +++ b/activerecord/lib/active_record/validations/associated.rb @@ -5,7 +5,7 @@ module ActiveRecord class AssociatedValidator < ActiveModel::EachValidator #:nodoc: def validate_each(record, attribute, value) if Array(value).reject { |r| valid_object?(r) }.any? - record.errors.add(attribute, :invalid, options.merge(value: value)) + record.errors.add(attribute, :invalid, **options.merge(value: value)) end end diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb index 3528ac045f..19a2c6e367 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -1298,7 +1298,7 @@ class TestAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCase # Stub the save method of the @pirate.ship instance to raise an exception class << @pirate.ship - def save(*args) + def save(*, **) super raise "Oh noes!" end