ability to track resources used in conference

This commit is contained in:
shlok007 2017-02-06 16:11:22 +05:30
parent 945b4aac60
commit 3065766da9
17 changed files with 281 additions and 2 deletions

10
app/models/resource.rb Normal file
View file

@ -0,0 +1,10 @@
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