diff options
Diffstat (limited to 'registration.rb')
-rw-r--r-- | registration.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/registration.rb b/registration.rb index 3638ed7..8501a37 100644 --- a/registration.rb +++ b/registration.rb @@ -13,8 +13,20 @@ class RegistrationApp < Sinatra::Base config_file File.join(settings.root, 'config.yml') + + helpers do + def accept_registrations + start_date = Date.parse(settings.accept_registrations[:start]) + end_date = Date.parse(settings.accept_registrations[:stop]) + start_date <= Date.today && end_date > Date.today + end + end + get '/' do - #erb :registration_closed + if !accept_registrations + return erb :registration_closed + end + @band = Band.new 3.times { @band.songs << Song.new } erb :index |