5 lines
163 B
Ruby
5 lines
163 B
Ruby
class Purchase < ApplicationRecord
|
|
validates :sale_type, :inclusion => { :in => %w{rented bought} }
|
|
validates :quantity, numericality: { greater_than: 0 }
|
|
end
|