Method: MongoidHashQuery::Aggregation#apply_aggregations
- Defined in:
- lib/mongoid_hash_query/aggregation.rb
#apply_aggregations(available_aggr, asked_aggr, field) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/mongoid_hash_query/aggregation.rb', line 55 def apply_aggregations(available_aggr, asked_aggr, field) = HashWithIndifferentAccess.new available_aggr.each do |k, v| if asked_aggr[k] [k] = resource.send(v,field) [k] = [k].to_f if [k].is_a? BigDecimal end end return end |