Move new class to services and rename it

This commit is contained in:
Pau Perez
2019-03-11 18:28:25 +01:00
parent 347aa3c4ae
commit 931cb89a9d
3 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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) }.

View File

@@ -1,6 +1,6 @@
require 'spec_helper'
describe DistributedValidProducts do
describe OrderCycleDistributedProducts do
let(:order_cycle) { OrderCycle.new }
let(:distributor) { instance_double(Enterprise) }