From 75ccc5c72f6a5699c1a500a06258e4f2397b40e6 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 21 May 2023 15:58:01 +0100 Subject: [PATCH] Simplify product images delegation mess (cherry picked from commit d4188da7c1446d6b9bca1a4735ae3815dc6bc851) --- app/models/spree/product.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index bf162b24d5..723553a946 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -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