Class: Workarea::DataFile::Export

Inherits:
Object
  • Object
show all
Includes:
ApplicationDocument, Operation
Defined in:
app/models/workarea/data_file/export.rb

Instance Method Summary collapse

Methods included from Operation

#complete?, #file_type, #format, #mime_type, #model_class, #name, #sample_file_content, #samples, #tempfile

Methods included from ApplicationDocument

#releasable?

Methods included from Sidekiq::Callbacks

assert_valid_config!, async, disable, enable, inline, #run_callbacks

Methods included from Mongoid::Document

#embedded_children

Instance Method Details

#modelsObject



21
22
23
# File 'app/models/workarea/data_file/export.rb', line 21

def models
  @models ||= AdminQueryOperation.new(attributes)
end

#process!Object



15
16
17
18
19
# File 'app/models/workarea/data_file/export.rb', line 15

def process!
  set(started_at: Time.current)
  run_callbacks(:process) { format.export! }
  update_attributes!(file: tempfile.tap(&:close), completed_at: Time.current)
end