Skip to content

Instantly share code, notes, and snippets.

View pbharadiya's full-sized avatar
🎯
Happy Coding!

Parth Bharadiya pbharadiya

🎯
Happy Coding!
View GitHub Profile
@ayerdines
ayerdines / generic_job.rb
Last active April 21, 2023 06:03
handle_asynchronously, delay with sidekiq, make sidekiq work with instance methods
class GenericJob
include Sidekiq::Job
def perform(klass, id, undelayed_method, *args)
object = klass.constantize.find(id)
object.send(undelayed_method, *args)
end
end