mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Fix not_empty scope
This commit is contained in:
@@ -107,7 +107,7 @@ module Spree
|
||||
|
||||
# -- Scopes
|
||||
scope :not_empty, -> {
|
||||
joins(:line_items).group(:id).having("count(spree_line_items.id) > 0")
|
||||
left_outer_joins(:line_items).where.not(spree_line_items: { id: nil })
|
||||
}
|
||||
|
||||
scope :managed_by, lambda { |user|
|
||||
|
||||
@@ -16,7 +16,7 @@ describe SearchOrders do
|
||||
let(:service) { SearchOrders.new(params, enterprise_user) }
|
||||
|
||||
it 'returns orders' do
|
||||
expect(service.orders.count.length).to eq 3
|
||||
expect(service.orders.count).to eq 3
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user