mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
remove ids usage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user