Sha256: 4914525521d984f8a12521b6f3b071263274e9c68d827051ae425256610bce67

Contents?: true

Size: 534 Bytes

Versions: 29

Compression:

Stored size: 534 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.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

29 entries across 29 versions & 1 rubygems

Version Path
directiverecord-0.1.31 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.30 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.29 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.28 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.27 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.26 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.25 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.24 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.23 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.22 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.21 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.20 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.19 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.18 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.17 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.16 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.15 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.14 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.13 lib/directive_record/gem_ext/active_record/base.rb
directiverecord-0.1.12 lib/directive_record/gem_ext/active_record/base.rb