1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/models/coupon.rb

10 lines
273 B
Ruby
Raw Normal View History

2016-08-03 17:25:00 +02:00
class Coupon < ActiveRecord::Base
has_many :invoices
2016-08-03 17:25:00 +02:00
validates :code, presence: true
validates :code, format: { with: /[A-Z0-9]+/ ,message: 'only caps letters and numbers'}
validates :percent_off, presence: true
validates :percent_off, :inclusion => 0..100
end