mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
Update Price#variant
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user