super-graph/example/app/models/purchase.rb
Vikram Rangnekar b9d38a5e9d First commit
2019-03-24 09:57:29 -04:00

5 lines
163 B
Ruby

class Purchase < ApplicationRecord
validates :sale_type, :inclusion => { :in => %w{rented bought} }
validates :quantity, numericality: { greater_than: 0 }
end