class HasAttachable::Worker

Public Instance Methods

perform(method, options) click to toggle source
# File lib/has_attachable/worker.rb, line 11
def perform(method, options)
  send("#{method}", Hash[options.map{ |k, v| [k.to_sym, v] }])
end
process(options) click to toggle source
# File lib/has_attachable/worker.rb, line 15
def process(options)
  object = options[:klass].classify.constantize.unscoped.where(id: options[:id]).first
  object.send(options[:context]).cache_stored_file! 
  object.send(options[:context]).retrieve_from_cache!(object.send(options[:context]).cache_name)
  object.send(options[:context]).recreate_versions!
  object.untrack_job_id(options[:context])
end
remove(options) click to toggle source
# File lib/has_attachable/worker.rb, line 23
def remove(options)
  object = options[:klass].classify.constantize.unscoped.where(id: options[:id]).first
  object.send("remove_#{options[:context]}!")
  object.untrack_job_id(options[:context])
end