module Switchman::Arel::Visitors::ToSql

Public Instance Methods

quote_local_table_name(name) click to toggle source

rubocop:enable Naming/MethodName

# File lib/switchman/arel.rb, line 31
def quote_local_table_name(name)
  return name if ::Arel::Nodes::SqlLiteral === name

  @connection.quote_local_table_name(name)
end
visit_Arel_Attributes_Attribute(*args) click to toggle source
# File lib/switchman/arel.rb, line 22
def visit_Arel_Attributes_Attribute(*args)
  o = args.first
  join_name = o.relation.table_alias || o.relation.name
  result = "#{quote_local_table_name join_name}.#{quote_column_name o.name}"
  args.last << result
end
visit_Arel_Nodes_TableAlias(*args) click to toggle source

rubocop:disable Naming/MethodName

# File lib/switchman/arel.rb, line 15
def visit_Arel_Nodes_TableAlias(*args)
  o, collector = args
  collector = visit o.relation, collector
  collector << ' '
  collector << quote_local_table_name(o.name)
end