Files
openfoodnetwork/app/services/permitted_attributes/variant.rb
cyrillefr 6d6164c8f6 Keep stock selection when error on saving
- 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
2025-02-12 16:01:21 +01:00

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