Method: Arel::SelectManager#group

Defined in:
activerecord/lib/arel/select_manager.rb

#group(*columns) ⇒ Object


74
75
76
77
78
79
80
81
82
83
# File 'activerecord/lib/arel/select_manager.rb', line 74

def group(*columns)
  columns.each do |column|
    # FIXME: backwards compat
    column = Nodes::SqlLiteral.new(column) if String === column
    column = Nodes::SqlLiteral.new(column.to_s) if Symbol === column

    @ctx.groups.push Nodes::Group.new column
  end
  self
end