Files
openfoodnetwork/app/models/semantic_link.rb
Maikel Linke 1ce0b25bb0 Switch SemanticLink to use new association
And ActiveRecord magic does the rest when used correctly.
2024-11-19 15:53:58 +11:00

11 lines
258 B
Ruby

# frozen_string_literal: true
# Link a Spree::Variant to an external DFC SuppliedProduct.
class SemanticLink < ApplicationRecord
self.ignored_columns += [:variant_id]
belongs_to :subject, polymorphic: true
validates :semantic_id, presence: true
end