mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Apply Changes Suggested by Code Review
This commit is contained in:
@@ -21,7 +21,7 @@ module Spree
|
||||
belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
|
||||
|
||||
has_many :offsets, -> { where("source_type = 'Spree::Payment' AND amount < 0").completed },
|
||||
class_name: "Spree::Payment", foreign_key: :source_id, dependent: :nullify
|
||||
class_name: "Spree::Payment", foreign_key: :source_id, dependent: :restrict_with_exception
|
||||
has_many :log_entries, as: :source, dependent: :destroy
|
||||
|
||||
has_one :adjustment, as: :adjustable, dependent: :destroy
|
||||
|
||||
@@ -16,7 +16,7 @@ module Spree
|
||||
has_many :shipping_rates, inverse_of: :shipping_method, dependent: :destroy
|
||||
has_many :shipments, through: :shipping_rates
|
||||
has_many :shipping_method_categories, dependent: :destroy
|
||||
has_many :shipping_categories, through: :shipping_method_categories, dependent: nil
|
||||
has_many :shipping_categories, through: :shipping_method_categories
|
||||
has_many :distributor_shipping_methods, dependent: :destroy
|
||||
has_many :distributors, through: :distributor_shipping_methods,
|
||||
class_name: 'Enterprise',
|
||||
|
||||
@@ -38,7 +38,6 @@ module Spree
|
||||
|
||||
has_many :stock_items, dependent: :destroy, inverse_of: :variant
|
||||
has_many :stock_locations, through: :stock_items
|
||||
has_many :stock_movements, through: :stock_items, dependent: :destroy
|
||||
has_many :images, -> { order(:position) }, as: :viewable,
|
||||
dependent: :destroy,
|
||||
class_name: "Spree::Image"
|
||||
|
||||
Reference in New Issue
Block a user