super-graph/examples/rails-app/app/models/purchase.rb

5 lines
163 B
Ruby
Raw Permalink Normal View History

2019-03-24 14:57:29 +01:00
class Purchase < ApplicationRecord
validates :sale_type, :inclusion => { :in => %w{rented bought} }
validates :quantity, numericality: { greater_than: 0 }
end