mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Move new class to services and rename it
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# variants are added to that product, but not the order cycle, then the master
|
||||
# variant should not available for customers to purchase. This class filters
|
||||
# out such products so that the customer cannot purchase them.
|
||||
class DistributedValidProducts
|
||||
class OrderCycleDistributedProducts
|
||||
def initialize(order_cycle, distributor)
|
||||
@order_cycle = order_cycle
|
||||
@distributor = distributor
|
||||
@@ -35,7 +35,7 @@ module OpenFoodNetwork
|
||||
return unless @order_cycle
|
||||
scoper = ScopeProductToHub.new(@distributor)
|
||||
|
||||
DistributedValidProducts.new(@order_cycle, @distributor).
|
||||
OrderCycleDistributedProducts.new(@order_cycle, @distributor).
|
||||
relation.
|
||||
order(taxon_order).
|
||||
each { |product| scoper.scope(product) }.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe DistributedValidProducts do
|
||||
describe OrderCycleDistributedProducts do
|
||||
let(:order_cycle) { OrderCycle.new }
|
||||
let(:distributor) { instance_double(Enterprise) }
|
||||
|
||||
Reference in New Issue
Block a user