Refactor registration_open? method, part II
This commit is contained in:
parent
0d8a77c9ef
commit
f180ce0d27
1 changed files with 2 additions and 6 deletions
|
|
@ -140,12 +140,8 @@ class Conference < ActiveRecord::Base
|
||||||
# registration period.
|
# registration period.
|
||||||
# * +true+ -> If today is in the registration period.
|
# * +true+ -> If today is in the registration period.
|
||||||
def registration_open?
|
def registration_open?
|
||||||
today = Date.current
|
registration_dates_given? &&
|
||||||
if registration_dates_given?
|
(registration_period.start_date..registration_period.end_date).cover?(Date.current)
|
||||||
(registration_period.start_date..registration_period.end_date).cover?(today)
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue