1 2 3 4 5 6 7 8 9 10 11 12
module Arel class Group < Compound attributes :relation, :groupings deriving :== def initialize(relation, *groupings, &block) @relation = relation @groupings = (groupings + arguments_from_block(relation, &block)) \ .collect { |g| g.bind(relation) } end end end