mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-17 11:54:22 +01:00
10 lines
272 B
Ruby
10 lines
272 B
Ruby
class Coupon < ActiveRecord::Base
|
|
has_many :invoice
|
|
|
|
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
|