Module: MoneyAttribute::SumAmount Private
- Included in:
- QueryMethods
- Defined in:
- lib/money_attribute/query/sum.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Internal sum resolution for the sum_amount query helper.
Instance Method Summary collapse
-
#sum_amount(attr) ⇒ Array<Mint::Money>
private
Sums money-aware amounts for a single attribute.
Instance Method Details
#sum_amount(attr) ⇒ Array<Mint::Money>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sums money-aware amounts for a single attribute.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/money_attribute/query/sum.rb', line 14 def sum_amount(attr) raise ArgumentError, 'No attribute specified' if attr.nil? spec = money_attribute_spec!(attr) if spec.composite? resolve_composite_sum(spec) else resolve_single_sum(spec) end end |