Allow confirmed speakers to register anytime

If the registration period is over then speakers of confirmed events
can't register anymore. They should be able to, since they are gonna be
there anyway.

* Allow the speakers of confirmed events to register regardless of the
registration period
* Provision for registrations of confirmed speakers, so as not to
exceed the registration limit
* Add scope for registered speakers

Fix #829 and fix #802
This commit is contained in:
AEtherC0r3 2017-05-03 23:42:53 +03:00 committed by Stella Rouzi
parent 1c12200003
commit fdff485b3e
5 changed files with 16 additions and 5 deletions

View file

@ -46,6 +46,10 @@ class Program < ActiveRecord::Base
def confirmed
joins(:events).where(events: { state: :confirmed })
end
def registered(conference)
joins(:registrations).where('registrations.conference_id = ?', conference.id)
end
end
accepts_nested_attributes_for :event_types, allow_destroy: true