Class: Delayed::Web::Job::Mongoid
- Inherits:
-
Object
- Object
- Delayed::Web::Job::Mongoid
- Defined in:
- app/models/delayed/web/job/mongoid.rb
Class Method Summary collapse
Class Method Details
.all ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/models/delayed/web/job/mongoid.rb', line 9 def self.all jobs = Delayed::Job.order_by(created_at: 'desc').limit(100) Enumerator.new do |enumerator| jobs.each do |job| enumerator.yield decorate(job) end end end |
.decorate(job) ⇒ Object
18 19 20 |
# File 'app/models/delayed/web/job/mongoid.rb', line 18 def self.decorate job ActiveRecordDecorator.new StatusDecorator.new(job) end |
.find(*args) ⇒ Object
5 6 7 |
# File 'app/models/delayed/web/job/mongoid.rb', line 5 def self.find *args decorate Delayed::Job.find(*args) end |