remove ids usage

This commit is contained in:
Ahmed Ejaz
2025-03-05 03:27:00 +05:00
parent 9867d0bc3a
commit f132d99df4

View File

@@ -140,6 +140,15 @@ module Spree
end
}
scope :editable_by_producers, ->(enterprises) {
joins(
:distributor, line_items: :supplier
).where(
supplier: enterprises,
distributor: { enable_producers_to_edit_orders: true }
)
}
scope :distributed_by_user, lambda { |user|
if user.admin?
where(nil)
@@ -171,14 +180,6 @@ module Spree
scope :invoiceable, -> { where(state: [:complete, :resumed]) }
scope :by_state, lambda { |state| where(state:) }
scope :not_state, lambda { |state| where.not(state:) }
scope :editable_by_producers, ->(enterprises) {
joins(
:distributor, line_items: :supplier
).where(
supplier: { id: enterprises.ids },
distributor: { enable_producers_to_edit_orders: true }
)
}
def initialize(*_args)
@checkout_processing = nil