Sha256: 98d3f84e901f6db3012367230d8dcb3643cf368cbf64ffab6979b370a5d79c7a

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

module ActiveRecord
  class Base

    def self.to_qry(*args)
      DirectiveRecord::Query.new(self, extract_connection(args)).to_sql(*args)
    end

    def self.qry(*args)
      extract_connection(args).select_rows to_qry(*args)
    end

    def self.qry_value(*args)
      extract_connection(args).select_value to_qry(*args)
    end

    def self.qry_values(*args)
      extract_connection(args).select_values to_qry(*args)
    end

    def self.to_trend_qry(q1, q2, join_column_count, options)
      DirectiveRecord::Query.new(self).to_trend_sql(q1, q2, join_column_count, options)
    end

  private

    def self.extract_connection(args)
      (args[-1][:connection] if args[-1].is_a?(Hash)) || connection
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
directiverecord-0.1.32 lib/directive_record/gem_ext/active_record/base.rb