mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 14:11:10 +00:00
11 lines
236 B
Ruby
11 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
|