super-graph/examples/rails-app/app/models/purchase.rb
2019-10-05 00:49:39 -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