method

collect_ctes

Importance_0
v6.1.7.7 - Show latest stable - 0 notes - Class: ToSql
collect_ctes(children, collector) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/arel/visitors/to_sql.rb, line 877
        def collect_ctes(children, collector)
          children.each_with_index do |child, i|
            collector << ", " unless i == 0

            case child
            when Arel::Nodes::As
              name = child.left.name
              relation = child.right
            when Arel::Nodes::TableAlias
              name = child.name
              relation = child.relation
            end

            collector << quote_table_name(name)
            collector << " AS "
            visit relation, collector
          end

          collector
        end
Register or log in to add new notes.