Sha256: 6b6c408e317bd828be0675dd991bef465847b137cc2f0f32bc09f7ee4a968ed9

Contents?: true

Size: 713 Bytes

Versions: 4

Compression:

Stored size: 713 Bytes

Contents

class CTEProxy
  include ActiveRecord::Querying
  include ActiveRecord::Sanitization::ClassMethods
  include ActiveRecord::Reflection::ClassMethods

  attr_accessor :reflections, :current_scope
  attr_reader :connection, :arel_table

  def initialize(name, model)
    @name = name
    @arel_table = Arel::Table.new(name)
    @model = model
    @connection = model.connection
    @reflections = {}
  end

  def name
    @name
  end

  def table_name
    name
  end

  def column_names
    @model.column_names
  end

  def columns_hash
    @model.columns_hash
  end

  def primary_key
    @model.primary_key
  end

  def instantiate(record, column_types = {})
    @model.instantiate(record, column_types)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
postgres_ext-2.2.0 lib/postgres_ext/active_record/cte_proxy.rb
postgres_ext-2.1.3 lib/postgres_ext/active_record/cte_proxy.rb
postgres_ext-2.1.2 lib/postgres_ext/active_record/cte_proxy.rb
postgres_ext-2.1.1 lib/postgres_ext/active_record/cte_proxy.rb