Class: Maintenance::LegacyAmazonVariation
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Maintenance::LegacyAmazonVariation
- Defined in:
- app/services/maintenance/legacy_amazon_variation.rb
Overview
ActiveRecord shim over the legacy_amazon_variations backup table — the
renamed amazon_variations table, kept read-only after AmazonVariation was
absorbed into VariantGroup amazon rows (external_sku = parent SKU,
external_id = ASIN, channel_settings = the Amazon definition).
Exists solely so AmazonVariationAbsorption and
VariantGroupBackfill can run against production (and be
tested); no app code may use it. Drops together with the legacy_* tables
once the production absorption is verified.
Constant Summary
Constants included from Models::Schedulable
Models::Schedulable::SIMPLE_FORM_OPTIONS
Belongs to collapse
- #amazon_marketplace ⇒ AmazonMarketplace
-
#variant_group ⇒ VariantGroup
The VariantGroup family / amazon row this variation was absorbed into.
Has many collapse
- #catalog_items ⇒ ActiveRecord::Relation<::CatalogItem>
- #edi_documents ⇒ ActiveRecord::Relation<::EdiDocument>
-
#items ⇒ ActiveRecord::Relation<::Item>
class_name pinned to the root — inside Maintenance:: a bare Item resolves to Maintenance::Item (a maintenance service, not the model).
Has and belongs to many collapse
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::Schedulable
Methods included from Models::AfterCommittable
Methods included from Models::EventPublishable
Instance Method Details
#amazon_browse_nodes ⇒ ActiveRecord::Relation<AmazonBrowseNode>
31 32 33 |
# File 'app/services/maintenance/legacy_amazon_variation.rb', line 31 has_and_belongs_to_many :amazon_browse_nodes, join_table: 'legacy_amazon_browse_nodes_variations', foreign_key: :amazon_variation_id |
#amazon_marketplace ⇒ AmazonMarketplace
18 |
# File 'app/services/maintenance/legacy_amazon_variation.rb', line 18 belongs_to :amazon_marketplace |
#catalog_items ⇒ ActiveRecord::Relation<::CatalogItem>
24 25 |
# File 'app/services/maintenance/legacy_amazon_variation.rb', line 24 has_many :catalog_items, class_name: '::CatalogItem', inverse_of: false, dependent: nil |
#edi_documents ⇒ ActiveRecord::Relation<::EdiDocument>
29 30 |
# File 'app/services/maintenance/legacy_amazon_variation.rb', line 29 has_many :edi_documents, class_name: '::EdiDocument', inverse_of: false, dependent: nil |
#items ⇒ ActiveRecord::Relation<::Item>
class_name pinned to the root — inside Maintenance:: a bare Item
resolves to Maintenance::Item (a maintenance service, not the model).
28 |
# File 'app/services/maintenance/legacy_amazon_variation.rb', line 28 has_many :items, -> { distinct }, through: :catalog_items, source: :item, class_name: '::Item' |
#variant_group ⇒ VariantGroup
The VariantGroup family / amazon row this variation was absorbed into.
DB-side ON DELETE SET NULL keeps the backup table from blocking
variant_group deletion.
22 |
# File 'app/services/maintenance/legacy_amazon_variation.rb', line 22 belongs_to :variant_group, optional: true |