Class: HasAttachable::Worker
- Inherits:
-
Object
- Object
- HasAttachable::Worker
- Includes:
- Sidekiq::Status::Worker, Sidekiq::Worker
- Defined in:
- lib/has_attachable/worker.rb
Instance Method Summary collapse
Instance Method Details
#perform(method, options) ⇒ Object
11 12 13 |
# File 'lib/has_attachable/worker.rb', line 11 def perform(method, ) send("#{method}", Hash[.map{ |k, v| [k.to_sym, v] }]) end |
#process(options) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/has_attachable/worker.rb', line 15 def process() object = [:klass].classify.constantize.unscoped.where(id: [:id]).first object.send([:context]).cache_stored_file! object.send([:context]).retrieve_from_cache!(object.send([:context]).cache_name) object.send([:context]).recreate_versions! object.untrack_job_id([:context]) end |
#remove(options) ⇒ Object
23 24 25 26 27 |
# File 'lib/has_attachable/worker.rb', line 23 def remove() object = [:klass].classify.constantize.unscoped.where(id: [:id]).first object.send("remove_#{[:context]}!") object.untrack_job_id([:context]) end |