From 0188b1c28945a8f7f68cb3553b51ffebaef74a9d Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 6 Sep 2019 07:38:41 +0900 Subject: [PATCH] Include kwargs definition in the generated method signatures and method calls --- activemodel/lib/active_model/attribute_methods.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 1a4e0b8e59..6763911ae4 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -361,12 +361,12 @@ module ActiveModel # and `send` if the given names cannot be compiled. def define_proxy_call(include_private, mod, name, target, *extra) defn = if NAME_COMPILABLE_REGEXP.match?(name) - "def #{name}(*args)" + "def #{name}(*args, **options)" else - "define_method(:'#{name}') do |*args|" + "define_method(:'#{name}') do |*args, **options|" end - extra = (extra.map!(&:inspect) << "*args").join(", ") + extra = (extra.map!(&:inspect) << "*args, **options").join(", ") body = if CALL_COMPILABLE_REGEXP.match?(target) "#{"self." unless include_private}#{target}(#{extra})"