mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Fix keyword args for hash parameter in LiteralInvoker when migrating
to ruby 3.2
This commit is contained in:
parent
164057cc74
commit
4c7405bf36
1 changed files with 3 additions and 1 deletions
|
@ -30,7 +30,9 @@ module AASM
|
||||||
raise(*record_error) unless record.respond_to?(subject, true)
|
raise(*record_error) unless record.respond_to?(subject, true)
|
||||||
return record.__send__(subject) if subject_arity.zero?
|
return record.__send__(subject) if subject_arity.zero?
|
||||||
return record.__send__(subject, *args) if subject_arity < 0
|
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
|
end
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue