Class: Attached::Job
- Inherits:
-
Object
- Object
- Attached::Job
- Defined in:
- lib/attached/job.rb
Class Method Summary collapse
Class Method Details
.enqueue(attachment) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/attached/job.rb', line 16 def self.enqueue() klass = .instance.class.name id = .instance.id method = .name .status = 'processing' self.perform(klass, id, method) end |
.perform(klass, id, method) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/attached/job.rb', line 6 def self.perform(klass, id, method) object = klass.constantize.find(id) = object.send(name) .reprocess! .status = 'active' object.save end |