Sha256: 6004478d0894a5d223c0533a87140da23181ee69305fe8a35536e771346e1d73

Contents?: true

Size: 746 Bytes

Versions: 7

Compression:

Stored size: 746 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

  delegate :column_names, :columns_hash, :model_name, :primary_key, :attribute_alias?,
    :aggregate_reflections, :instantiate, :type_for_attribute, :relation_delegate_class, to: :@model

  private

  def reflections
    @_reflections
  end

  alias _reflections reflections
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
postgres_with-1.0.0 lib/postgres_with/active_record/cte_proxy.rb
postgres_with-0.0.2 lib/postgres_with/active_record/cte_proxy.rb
postgres_with-0.0.1 lib/postgres_with/active_record/cte_proxy.rb
postgres_ext-3.0.1 lib/postgres_ext/active_record/cte_proxy.rb
postgres_ext-3.0.0 lib/postgres_ext/active_record/cte_proxy.rb
postgres_ext-2.4.1 lib/postgres_ext/active_record/cte_proxy.rb
postgres_ext-2.4.0 lib/postgres_ext/active_record/cte_proxy.rb