Class: Arel::Visitors::ToSql

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

Direct Known Subclasses

MySQL, PostgreSQL, SQLite

Instance Method Summary collapse

Methods inherited from Visitor

#accept

Constructor Details

#initialize(connection) ⇒ ToSql

Returns a new instance of ToSql.



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

def initialize(connection)
  super()
  @connection = connection
end

Instance Method Details

#compile(node, collector = Arel::Collectors::SQLString.new) ⇒ Object



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

def compile(node, collector = Arel::Collectors::SQLString.new)
  accept(node, collector).value
end