Files
openfoodnetwork/app/models/variant_link.rb
David Cook 1c89e9979e CreateVariantLinks [migration]
Tried using the rails generator, but as usual it was a waste of time becuase it doesn't handle unusual cases.

I found more good guidance from that stackoverflow post:
> why are you worrying about your indexes? Build your app!

Something's not right in the model, see next commit.
2026-03-11 11:08:47 +11:00

7 lines
217 B
Ruby

# frozen_string_literal: true
class VariantLink < ApplicationRecord
belongs_to :source_variant, class_name: 'Spree::Variant', touch: true
belongs_to :target_variant, class_name: 'Spree::Variant', touch: true
end