Sha256: 337fdd90b61c2c41dfd5b98d6a042319105c2f599eebbbc77b766923f70322b6

Contents?: true

Size: 331 Bytes

Versions: 7

Compression:

Stored size: 331 Bytes

Contents

require 'active_record/querying'

module ActiveRecord::Querying
  delegate :with, :ranked, to: :all

  def from_cte(name, expression)
    table = Arel::Table.new(name)

    cte_proxy = CTEProxy.new(name, self)
    relation = ActiveRecord::Relation.new cte_proxy, cte_proxy.arel_table
    relation.with name => expression
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
postgres_ext-2.4.0.beta.1 lib/postgres_ext/active_record/querying.rb
postgres_ext-2.3.0 lib/postgres_ext/active_record/querying.rb
postgres_ext-2.2.0 lib/postgres_ext/active_record/querying.rb
postgres_ext-2.1.3 lib/postgres_ext/active_record/querying.rb
postgres_ext-2.1.2 lib/postgres_ext/active_record/querying.rb
postgres_ext-2.1.1 lib/postgres_ext/active_record/querying.rb
postgres_ext-2.1.0 lib/postgres_ext/active_record/querying.rb