mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
- added 2 not to be persisted attributes aimed at dealing with the UI
- added them to the permitted list
- updated view to switch mode about on_hand/on_demand
that is: from an already persisted variant or not
- Not persisted deals with on_*_desired not to be persisted fields
- Persisted mode deals with regular on_* fields
- the corresponding spec for both on_hand/on_demand
16 lines
486 B
Ruby
16 lines
486 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PermittedAttributes
|
|
class Variant
|
|
def self.attributes
|
|
[
|
|
:id, :sku, :on_hand, :on_hand_desired, :on_demand, :on_demand_desired,
|
|
:shipping_category_id, :price, :unit_value,
|
|
:unit_description, :variant_unit, :variant_unit_name, :variant_unit_scale, :display_name,
|
|
:display_as, :tax_category_id, :weight, :height, :width, :depth, :taxon_ids,
|
|
:primary_taxon_id, :supplier_id
|
|
]
|
|
end
|
|
end
|
|
end
|