mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fixing wrong incrementation
This commit is contained in:
committed by
Maikel Linke
parent
843bca9ea3
commit
f40bd9cfcb
@@ -5,7 +5,7 @@ module Spree
|
||||
extend Spree::LocalizedNumber
|
||||
|
||||
localize_number :preferred_first_item,
|
||||
:preferred_additional_item
|
||||
:preferred_additional_item
|
||||
|
||||
def self.description
|
||||
I18n.t(:flexible_rate)
|
||||
@@ -14,7 +14,7 @@ module Spree
|
||||
def compute(object)
|
||||
sum = 0
|
||||
max = self.preferred_max_items.to_i
|
||||
items_count = line_items_for(object).map(&:quantity).sum
|
||||
items_count = line_items_for(object).map(&:quantity).sum
|
||||
# check max value to avoid divide by 0 errors
|
||||
unless max == 0
|
||||
if items_count > max
|
||||
|
||||
Reference in New Issue
Block a user