mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Reorder has_many relationship with :through option
If it's using :through it should be defined after the relationship it's connected to
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
module Spree
|
||||
class OptionType < ApplicationRecord
|
||||
has_many :products, through: :product_option_types
|
||||
has_many :option_values, -> { order(:position) }, dependent: :destroy
|
||||
has_many :product_option_types, dependent: :destroy
|
||||
has_many :products, through: :product_option_types
|
||||
|
||||
validates :name, :presentation, presence: true
|
||||
default_scope -> { order("#{table_name}.position") }
|
||||
|
||||
Reference in New Issue
Block a user