Class: MongoJob::Model::Worker

Inherits:
Object
  • Object
show all
Extended by:
MongoJob::Mixins::Document
Includes:
MongoMapper::Document
Defined in:
lib/mongojob/model/worker.rb

Class Method Summary collapse

Methods included from MongoJob::Mixins::Document

connection, database_name

Class Method Details

.tick(id, data) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/mongojob/model/worker.rb', line 25

def self.tick id, data
model_worker = Model::Worker.find id
model_worker ||= Model::Worker.create({
  id: id
  })
  model_worker.set data
end