Sha256: 71a8dd57c4be93c59ca38a4906722d0f43a64cba119e72248d0f11b871a0347b

Contents?: true

Size: 341 Bytes

Versions: 5

Compression:

Stored size: 341 Bytes

Contents

module Adhoq
  class Query < ActiveRecord::Base
    include Adhoq::TimeBasedOrders

    has_many :executions, dependent: :destroy, inverse_of: :query

    def execute!(report_format)
      executions.create! {|exe|
        exe.report_format = report_format
        exe.raw_sql       = query
      }.tap(&:generate_report!)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adhoq-0.0.6 app/models/adhoq/query.rb
adhoq-0.0.5 app/models/adhoq/query.rb
adhoq-0.0.4 app/models/adhoq/query.rb
adhoq-0.0.3 app/models/adhoq/query.rb
adhoq-0.0.2 app/models/adhoq/query.rb