Class: Export
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Export
- Defined in:
- app/models/export.rb
Instance Method Summary collapse
Instance Method Details
#build_filename ⇒ Object
25 26 27 |
# File 'app/models/export.rb', line 25 def build_filename File.join(Iqvoc.export_path, "#{self.token}.#{self.file_type}") end |
#fail!(exception) ⇒ Object
19 20 21 22 23 |
# File 'app/models/export.rb', line 19 def fail!(exception) self.output += exception.to_s + "\n\n" + exception.backtrace.join("\n") self.finished_at = Time.now self.save! end |
#finish! ⇒ Object
13 14 15 16 17 |
# File 'app/models/export.rb', line 13 def finish! self.success = true self.finished_at = Time.now self.save! end |
#jobs ⇒ Object
29 30 31 32 |
# File 'app/models/export.rb', line 29 def jobs Rails.logger.debug "Deleting jobs for export #{self.id} (#{self.to_global_id})" Delayed::Backend::ActiveRecord::Job.where(delayed_global_reference_id: self.to_global_id.to_s) end |