Class: Adhoq::Execution

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
TimeBasedOrders
Defined in:
app/models/adhoq/execution.rb

Instance Method Summary collapse

Instance Method Details

#generate_report!Object



10
11
12
13
14
15
16
17
# File 'app/models/adhoq/execution.rb', line 10

def generate_report!
  build_report.generate!
  update(status: :success)
rescue => e
  Rails.logger.error(e)
  self.report = nil
  update(status: :failure)
end

#nameObject



19
20
21
# File 'app/models/adhoq/execution.rb', line 19

def name
  [query.name, created_at.strftime('%Y%m%d-%H%M%S'), report_format].join('.')
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  report.try(:available?) || status == "success"
end