Module: ActiveRecordQuery::Groupable

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_record_query/concerns/groupable.rb

Instance Method Summary collapse

Instance Method Details

#build_group_by(scope) ⇒ Object



16
17
18
19
20
# File 'lib/active_record_query/concerns/groupable.rb', line 16

def build_group_by(scope)
  arg_stacker = ArgumentStacker.new(self, :group_by)
  args = arg_stacker.list
  args.present? ? scope.group(*args.flatten) : scope
end