Skip to content

Commit

Permalink
move run_later methods to a module
Browse files Browse the repository at this point in the history
  • Loading branch information
vasconsaurus committed Sep 20, 2024
1 parent b510a7b commit 935f44f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/lib/generic_worker_helpers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module GenericWorkerHelpers
def run_later(klass_method, *method_args)
GenericWorker.perform_async(self.to_s, klass_method, *method_args)
end

def run_later_in(time, klass_method, *method_args)
GenericWorker.perform_in(time, self.to_s, klass_method, *method_args)
end
end
4 changes: 1 addition & 3 deletions config/initializers/class_extensions.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
class Class
def run_later_in(time, klass_method, *method_args)
GenericWorker.perform_in(time, self.to_s, klass_method, *method_args)
end
include GenericWorkerHelpers
end

0 comments on commit 935f44f

Please sign in to comment.