diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2016-08-16 21:57:15 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2016-08-16 21:57:15 +0200 |
commit | ac3fe82eb741f9ea8ddc0c709d3c302492f3a402 (patch) | |
tree | 6aca86a769b87bc7d1d17086641a6897ef33d01b /lib | |
parent | 9d3cee906330cbbe2dbd1bd4dcb88aa7c160baca (diff) | |
download | norsk-urskog-registrations-ac3fe82eb741f9ea8ddc0c709d3c302492f3a402.tar.gz norsk-urskog-registrations-ac3fe82eb741f9ea8ddc0c709d3c302492f3a402.tar.bz2 norsk-urskog-registrations-ac3fe82eb741f9ea8ddc0c709d3c302492f3a402.zip |
Move accept_registrations method to registration lib.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/registration.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/registration.rb b/lib/registration.rb index 6afe8b6..bebe326 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -1,5 +1,6 @@ require_relative 'band' require_relative 'pdf_form' +require 'date' require 'mail' def send_registration_emails_for(band, pdf_url) @@ -30,3 +31,9 @@ end def create_pdf_file_name(band) filename = "#{Date.today.iso8601}-#{sanitize(band.name)}-#{sanitize(band.city)}.pdf" end + +def accept_registrations(settings) + 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 |