Method: Amountable::JsonbMethods#amounts

Defined in:
lib/amountable/jsonb_methods.rb

#amountsObject



7
8
9
10
11
# File 'lib/amountable/jsonb_methods.rb', line 7

def amounts
  @_amounts ||= attribute(amounts_column_name).to_h['amounts'].to_h.map do |name, amount|
    Amountable::VirtualAmount.new(name: name, value_cents: amount['cents'], value_currency: amount['currency'], persistable: false, amountable: self)
  end.to_set
end