Module: Mongoid::Tracking::Aggregates

Defined in:
lib/mongoid/tracking/aggregates.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

DEPRECATED_TOKENS =
['hour', 'hours']

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

This module includes aggregate data extensions to Trackoid instances



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mongoid/tracking/aggregates.rb', line 9

def self.included(base)
  base.class_eval do
    extend ClassMethods

    class_attribute :aggregate_fields, :aggregate_klass
    self.aggregate_fields = {}
    self.aggregate_klass = nil
    delegate :aggregate_fields, :aggregate_klass, :aggregated?,
             to: "self.class"
  end
end