Fix Order line items association definition

Populating the cart was throwing an "Association Mismatch" error D:
This commit is contained in:
Matt-Yorkley
2021-05-11 15:07:28 +01:00
parent 0178cd7530
commit 67df6728f6

View File

@@ -35,7 +35,7 @@ module Spree
alias_attribute :shipping_address, :ship_address
has_many :state_changes, as: :stateful
has_many :line_items, -> { order('created_at ASC') }, dependent: :destroy
has_many :line_items, -> { order('created_at ASC') }, class_name: "Spree::LineItem", dependent: :destroy
has_many :payments, dependent: :destroy
has_many :return_authorizations, dependent: :destroy, inverse_of: :order
has_many :adjustments, -> { order "#{Spree::Adjustment.table_name}.created_at ASC" },