From 558457993ab569a3b5ae59289f787fd54b0a4c18 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 26 Mar 2021 19:21:21 +0000 Subject: [PATCH] Update Price#variant --- app/models/spree/price.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/models/spree/price.rb b/app/models/spree/price.rb index 54d4c39788..3fbc619bd3 100644 --- a/app/models/spree/price.rb +++ b/app/models/spree/price.rb @@ -4,7 +4,7 @@ module Spree class Price < ActiveRecord::Base acts_as_paranoid without_default_scope: true - belongs_to :variant, class_name: 'Spree::Variant' + belongs_to :variant, -> { with_deleted }, class_name: 'Spree::Variant' validate :check_price validates :amount, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true @@ -26,11 +26,6 @@ module Spree self[:amount] = parse_price(price) end - # Allow prices to access associated soft-deleted variants. - def variant - Spree::Variant.unscoped { super } - end - private def check_price