make apple points optional

a next step would be to move this to a plugin
This commit is contained in:
wvengen 2014-02-25 10:53:28 +01:00
parent f71b78665e
commit 3f032e5dd9
6 changed files with 11 additions and 5 deletions

View file

@ -85,7 +85,8 @@ class Ordergroup < Group
# The restriction can be deactivated for each ordergroup.
# Only ordergroups, which have participated in more than 5 orders in total and more than 2 orders in apple time period
def not_enough_apples?
FoodsoftConfig[:stop_ordering_under].present? and
FoodsoftConfig[:use_apple_points] and
FoodsoftConfig[:stop_ordering_under].present? and
!ignore_apple_restriction and
apples < FoodsoftConfig[:stop_ordering_under] and
group_orders.count > 5 and