Allow max_attendees to be nil

This commit is contained in:
Stella Rouzi 2016-05-15 14:01:30 +03:00
parent 65ee166570
commit 528243c8b9
7 changed files with 50 additions and 41 deletions

View file

@ -13,8 +13,7 @@ class Program < ActiveRecord::Base
end
def with_registration_open
where(require_registration: true, state: :confirmed).
map { |e| e if e.max_attendees > e.registrations.count }.compact
select { |e| e if e.registration_possible? }
end
# All confirmed events of the conference with attribute require_registration