Class: Export

Inherits:
ApplicationRecord show all
Defined in:
app/models/export.rb

Instance Method Summary collapse

Instance Method Details

#build_filenameObject



23
24
25
# File 'app/models/export.rb', line 23

def build_filename
  File.join(Iqvoc.export_path, "#{token}.#{file_type}")
end

#fail!(exception) ⇒ Object



17
18
19
20
21
# File 'app/models/export.rb', line 17

def fail!(exception)
  self.output = exception.to_s + "\n\n" + exception.backtrace.join("\n")
  self.finished_at = Time.now
  save!
end

#finish!(messages) ⇒ Object



10
11
12
13
14
15
# File 'app/models/export.rb', line 10

def finish!(messages)
  self.output = messages
  self.success = true
  self.finished_at = Time.now
  save!
end