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