Skip to content

Commit

Permalink
test: resolve ruby 2.4 spec issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NourEldinShobier committed Dec 28, 2023
1 parent 62f4b3a commit 918ab1a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/delayed/performable_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ def perform
# On ruby 2, rely on the implicit conversion from a hash to kwargs
def perform
return unless object

arguments = args.is_a?(Array) ? args : [args]

if kwargs.present?
object.send(method_name, *args, kwargs)
object.send(method_name, *arguments, kwargs)
else
object.send(method_name, *args)
object.send(method_name, *arguments)
end
end
end
Expand Down

0 comments on commit 918ab1a

Please sign in to comment.