Class: Chartable::Queries::Quarterly
- Inherits:
-
Object
- Object
- Chartable::Queries::Quarterly
- Defined in:
- lib/chartable/queries/quarterly.rb
Class Method Summary collapse
-
.call(scope, on:) ⇒ Hash
It returns analytics data for the quarterly period.
Class Method Details
.call(scope, on:) ⇒ Hash
It returns analytics data for the quarterly period. Example output: ‘2018” => 1, “Q2 2018” => 1`
8 9 10 |
# File 'lib/chartable/queries/quarterly.rb', line 8 def self.call(scope, on:) scope.group("CONCAT('Q', QUARTER(#{on}), DATE_FORMAT(#{on},' %Y'))").size end |