Class: CTEProxy

Inherits:
Object
  • Object
show all
Includes:
ActiveRecord::Querying, ActiveRecord::Reflection::ClassMethods, ActiveRecord::Sanitization::ClassMethods
Defined in:
lib/postgres_ext/active_record/cte_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ActiveRecord::Querying

#from_cte

Constructor Details

#initialize(name, model) ⇒ CTEProxy

Returns a new instance of CTEProxy.



9
10
11
12
13
14
15
# File 'lib/postgres_ext/active_record/cte_proxy.rb', line 9

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

Instance Attribute Details

#arel_tableObject (readonly)

Returns the value of attribute arel_table.



7
8
9
# File 'lib/postgres_ext/active_record/cte_proxy.rb', line 7

def arel_table
  @arel_table
end

#connectionObject (readonly)

Returns the value of attribute connection.



7
8
9
# File 'lib/postgres_ext/active_record/cte_proxy.rb', line 7

def connection
  @connection
end

#current_scopeObject

Returns the value of attribute current_scope.



6
7
8
# File 'lib/postgres_ext/active_record/cte_proxy.rb', line 6

def current_scope
  @current_scope
end

#reflections=(value) ⇒ Object

Sets the attribute reflections

Parameters:

  • value

    the value to set the attribute reflections to.



6
7
8
# File 'lib/postgres_ext/active_record/cte_proxy.rb', line 6

def reflections=(value)
  @reflections = value
end

Instance Method Details

#nameObject



17
18
19
# File 'lib/postgres_ext/active_record/cte_proxy.rb', line 17

def name
  @name
end

#table_nameObject



21
22
23
# File 'lib/postgres_ext/active_record/cte_proxy.rb', line 21

def table_name
  name
end