Sha256: c5b767aa3229280dbe7db11ea90b24fff0e6209bbaaee613bbba8fa7fb5b87c9
Contents?: true
Size: 642 Bytes
Versions: 4
Compression:
Stored size: 642 Bytes
Contents
module Adhoq class Execution < ActiveRecord::Base include Adhoq::TimeBasedOrders belongs_to :query has_one :report, dependent: :destroy, inverse_of: :execution delegate :supported_formats, to: Adhoq::Reporter def generate_report! build_report.generate! update_attributes(status: :success) rescue => e Rails.logger.error(e) self.report = nil update_attributes(status: :failure) end def name [query.name, created_at.strftime('%Y%m%d-%H%M%S'), report_format].join('.') end def success? report.try(:available?) || status == "success" end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
adhoq-1.0.0 | app/models/adhoq/execution.rb |
adhoq-0.5.0 | app/models/adhoq/execution.rb |
adhoq-0.5.0.beta1 | app/models/adhoq/execution.rb |
adhoq-0.4.0 | app/models/adhoq/execution.rb |