Class: Gitlab::Database::Aggregation::ActiveRecord::Mean
- Inherits:
-
Column
- Object
- PartDefinition
- Column
- Gitlab::Database::Aggregation::ActiveRecord::Mean
- Defined in:
- lib/gitlab/database/aggregation/active_record/mean.rb
Instance Attribute Summary
Attributes inherited from PartDefinition
#description, #expression, #formatter, #name, #secondary_expression, #type
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(name, type = :float, *args, **kwargs) ⇒ Mean
constructor
A new instance of Mean.
- #to_arel(context) ⇒ Object
Methods inherited from PartDefinition
#format_value, #instance_key, #parameterized?, #validate_part
Constructor Details
#initialize(name, type = :float, *args, **kwargs) ⇒ Mean
Returns a new instance of Mean.
8 9 10 |
# File 'lib/gitlab/database/aggregation/active_record/mean.rb', line 8 def initialize(name, type = :float, *args, **kwargs) super end |
Instance Method Details
#identifier ⇒ Object
12 13 14 |
# File 'lib/gitlab/database/aggregation/active_record/mean.rb', line 12 def identifier :"mean_#{name}" end |
#to_arel(context) ⇒ Object
16 17 18 |
# File 'lib/gitlab/database/aggregation/active_record/mean.rb', line 16 def to_arel(context) super.average end |