app/support/orders/item_adder.rb
# If the service has a survey or order form, we create one row for each quantity since
# each one will require a separate upload form.
If the service has a survey or order form, we create one row for each quantity since
each one will require a separate upload form.
If the service has a survey or order form we create one row for each quantity since each one will require a separate upload form .
def add_services(product, quantity, attributes)
    separate = (product.active_template? || product.active_survey?)
    repeat = separate ? quantity : 1
    individual_quantity = separate ? 1 : quantity
    Array.new(repeat) do
      create_order_detail({ product: product, quantity: individual_quantity }.merge(attributes))
    end
  end
def add_services ( product , quantity , attributes ) separate = ( product . active_template? || product . active_survey? ) repeat = separate ? quantity : 1 individual_quantity = separate ? 1 : quantity Array . new ( repeat ) do create_order_detail ( { product : product , quantity : individual_quantity } . merge ( attributes ) ) end end
If the service has a survey or order form, we create one row for each quantity since
each one will require a separate upload form.
If the service has a survey or order form we create one row for each quantity since each one will require a separate upload form .
# can't add single order_detail for service when it requires a template or a survey. # number of order details to add # quantity to add them with
product
<not_specific>
quantity
<not_specific>
attributes
<not_specific>