Class: Arel::Visitors::ToSql

Inherits:
Visitor
  • Object
show all
Defined in:
lib/arel/visitors/to_sql.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ ToSql

Returns a new instance of ToSql.



9
10
11
12
13
14
15
# File 'lib/arel/visitors/to_sql.rb', line 9

def initialize connection
  @connection     = connection
  @schema_cache   = connection.schema_cache
  @quoted_tables  = {}
  @quoted_columns = {}
  @last_column    = nil
end

Instance Attribute Details

#last_columnObject

Returns the value of attribute last_column.



7
8
9
# File 'lib/arel/visitors/to_sql.rb', line 7

def last_column
  @last_column
end

Instance Method Details

#accept(object) ⇒ Object



17
18
19
20
# File 'lib/arel/visitors/to_sql.rb', line 17

def accept object
  self.last_column = nil
  super
end