1
0
Fork 0
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:
Anil Kumar Maurya 2023-02-05 20:26:00 +08:00
parent 164057cc74
commit 4c7405bf36

View file

@ -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