mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
10 lines
236 B
Ruby
10 lines
236 B
Ruby
class Resource < ActiveRecord::Base
|
|
belongs_to :conference
|
|
validate :used_less_than_quantity
|
|
|
|
private
|
|
|
|
def used_less_than_quantity
|
|
errors.add(:used, 'can not be higher than total quantity') unless used <= quantity
|
|
end
|
|
end
|