diff --git a/lib/aasm/core/invokers/literal_invoker.rb b/lib/aasm/core/invokers/literal_invoker.rb index bb1af38..c8bdffc 100644 --- a/lib/aasm/core/invokers/literal_invoker.rb +++ b/lib/aasm/core/invokers/literal_invoker.rb @@ -30,7 +30,9 @@ module AASM raise(*record_error) unless record.respond_to?(subject, true) return record.__send__(subject) if subject_arity.zero? return record.__send__(subject, *args) if subject_arity < 0 - record.__send__(subject, *args[0..(subject_arity - 1)]) + req_args = args[0..(subject_arity - 1)] + return record.__send__(subject, **req_args[0]) if req_args[0].is_a?(Hash) + record.__send__(subject, *req_args) end # rubocop:enable Metrics/AbcSize