Sha256: 7436973f656d67dda336c59cb094afb5806c5cc367f798b1abf69a2dd2b52904
Contents?: true
Size: 604 Bytes
Versions: 5
Compression:
Stored size: 604 Bytes
Contents
module Avo module Fields class CurrencyField < BaseField def initialize(name, **args, &block) @defaults = { partial_name: 'currency-field', computable: true, } super(name, **args, &block) @currency = args[:currency].present? ? args[:currency].to_s : Avo.configuration.currency @locale = args[:locale].present? ? args[:locale].to_s : Avo.configuration.locale end def hydrate_field(fields, model, resource, view) { currency: @currency, locale: @locale, } end end end end
Version data entries
5 entries across 5 versions & 1 rubygems