1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

[bug] unable to create or edit percentage coupons

This commit is contained in:
Sylvain 2016-12-13 10:08:19 +01:00
parent ed2d3b4ff0
commit 4817da75d6
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@
- Improved automated testing
- Added an information notice about the processing time of deleting an administrator
- Fix a bug: unable to run rake db:migrate on first install
- Fix a bug: unable to create or edit a coupon of type 'percentage'
## v2.4.6 2016 Novembre 30

View File

@ -1,7 +1,7 @@
class CouponDiscountValidator < ActiveModel::Validator
def validate(record)
if !record.percent_off.nil?
unless [0..100].include? record.percent_off
unless (0..100).include? record.percent_off
record.errors[:percent_off] << 'Percentage must be included between 0 and 100'
end
elsif !record.amount_off.nil?