Simplify product images delegation mess

(cherry picked from commit d4188da7c1)
This commit is contained in:
Matt-Yorkley
2023-05-21 15:58:01 +01:00
committed by David Cook
parent aca72e6071
commit 75ccc5c72f

View File

@@ -75,16 +75,13 @@ module Spree
)
}
delegate_belongs_to :master, :sku, :price, :currency, :display_amount, :display_price,
delegate_belongs_to :master, :images, :sku, :price, :currency, :display_amount, :display_price,
:price_in, :amount_in, :unit_value, :unit_description
delegate :images_attributes=, :display_as=, to: :master
after_create :set_master_variant_defaults
after_save :save_master
delegate :images, to: :master, prefix: true
alias_method :images, :master_images
has_many :variant_images, -> { order(:position) }, source: :images,
through: :variants_including_master