Class: VariantGroupMember

Inherits:
ApplicationRecord show all
Defined in:
app/models/variant_group_member.rb

Overview

Explicit membership of an Item in a VariantGroup. An item belongs to at
most ONE default family and at most one override per catalog — the same SKU
can therefore sit in "TCT Kits" (default) and a differently-shaped Amazon US
override, but never in two default families (the TRT-prefix trap: Flex Rolls
and shower mats share a SKU prefix but must never share a family).

Constant Summary

Constants included from Models::Schedulable

Models::Schedulable::SIMPLE_FORM_OPTIONS

Instance Attribute Summary collapse

Belongs to collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::Schedulable

config

Methods included from Models::AfterCommittable

#after_commit

Methods included from Models::EventPublishable

#publish_event

Instance Attribute Details

#item_idvoid (readonly)

This method returns an undefined value.



15
# File 'app/models/variant_group_member.rb', line 15

validates :item_id, uniqueness: { scope: :variant_group_id }

Instance Method Details

#itemItem

Returns:



12
# File 'app/models/variant_group_member.rb', line 12

belongs_to :item

#variant_groupVariantGroup

Returns:



10
# File 'app/models/variant_group_member.rb', line 10

belongs_to :variant_group, inverse_of: :variant_group_members