Module: AggtiveRecord::EggScopes::Collation::CountBy::ClassMethods

Defined in:
lib/aggtive_record/egg_scopes/collation/count_by.rb

Overview

Public: convenience for #by_:time_period and #count self is a ActiveRecord scope

Instance Method Summary collapse

Instance Method Details

#count_by(time_period) ⇒ Object



11
12
13
14
# File 'lib/aggtive_record/egg_scopes/collation/count_by.rb', line 11

def count_by(time_period)
  span_foo = "by_#{time_period}"
  self.send(span_foo).count
end