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:
parent
ed2d3b4ff0
commit
4817da75d6
@ -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
|
||||
|
||||
|
@ -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?
|
||||
|
Loading…
x
Reference in New Issue
Block a user