Add booth limit

This commit is contained in:
nasia 2017-07-28 21:46:48 +03:00
parent 703813248d
commit b59cb88540
10 changed files with 66 additions and 18 deletions

View file

@ -738,6 +738,15 @@ class Conference < ActiveRecord::Base
(start_hour..(end_hour - 1)).cover?(current_hour) ? current_hour - start_hour : 0
end
##
#
# ====Returns
# * +True+ -> if accepted booths are equal to the booth limit
# * +False+ -> Accepted booths have not reached the booth limit
def maximum_accepted_booths?
booth_limit > 0 && booths.accepted.count + booths.confirmed.count >= booth_limit
end
##
# Return the current conference object to be used in RevisionCount
#