Class: Arel::Externalization

Inherits:
Compound show all
Includes:
Recursion::BaseCase
Defined in:
lib/arel/algebra/relations/utilities/externalization.rb,
lib/arel/engines/sql/relations/utilities/externalization.rb

Instance Attribute Summary

Attributes inherited from Compound

#relation

Attributes included from Relation

#count

Instance Method Summary collapse

Methods included from Recursion::BaseCase

#table

Methods inherited from Compound

#build_query, #engine, #eql?, #hash, requires, #unoperated_rows

Methods included from Relation

#bind, #call, #christener, #compiler, #exclusion_predicate_sql, #externalizable?, #externalize, #inclusion_predicate_sql, #join?, #primary_key, #session, #to_sql

Methods included from Relation::DefaultOperations

#groupings, #havings, #inserts, #joins, #locked, #orders, #projections, #skipped, #sources, #taken

Methods included from Relation::AttributeAccessable

#[], #find_attribute_matching_attribute, #find_attribute_matching_name, #position_of

Methods included from Relation::Operable

#alias, #join, #lock, #outer_join

Methods included from Relation::Operable::Writable

#delete, #insert, #update

Methods included from Relation::Enumerable

#each, #first

Instance Method Details

#attributesObject



10
11
12
# File 'lib/arel/algebra/relations/utilities/externalization.rb', line 10

def attributes
  @attributes ||= Header.new(relation.attributes.map { |a| a.to_attribute(self) })
end

#nameObject

REMOVEME



10
11
12
# File 'lib/arel/engines/sql/relations/utilities/externalization.rb', line 10

def name
  relation.name + '_external'
end

#table_sql(formatter = Sql::TableReference.new(relation)) ⇒ Object



5
6
7
# File 'lib/arel/engines/sql/relations/utilities/externalization.rb', line 5

def table_sql(formatter = Sql::TableReference.new(relation))
  formatter.select relation.compiler.select_sql, self
end

#wheresObject



6
7
8
# File 'lib/arel/algebra/relations/utilities/externalization.rb', line 6

def wheres
  []
end