Refactor registration_open? method
The registration_period is already checked in registration_dates_given? method. No need to check it twice
This commit is contained in:
parent
bc966259fb
commit
0d8a77c9ef
1 changed files with 1 additions and 1 deletions
|
|
@ -141,7 +141,7 @@ class Conference < ActiveRecord::Base
|
||||||
# * +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
|
today = Date.current
|
||||||
if registration_period && registration_dates_given?
|
if registration_dates_given?
|
||||||
(registration_period.start_date..registration_period.end_date).cover?(today)
|
(registration_period.start_date..registration_period.end_date).cover?(today)
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue