Sha256: 6f16bd3964dbbc00ecea7d7114cbefde4b82fe91c83fac30fe64ae8c8d599a5c
Contents?: true
Size: 623 Bytes
Versions: 18
Compression:
Stored size: 623 Bytes
Contents
module Avo module Fields class CurrencyField < Field def initialize(name, **args, &block) @defaults = { sortable: true, component: '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
18 entries across 18 versions & 1 rubygems