diff --git a/CHANGELOG.md b/CHANGELOG.md index 814cf6e68..bb3db7540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/app/validators/coupon_discount_validator.rb b/app/validators/coupon_discount_validator.rb index 35b81b0f6..072ae089f 100644 --- a/app/validators/coupon_discount_validator.rb +++ b/app/validators/coupon_discount_validator.rb @@ -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?