Simplify cfp_open? method

This commit is contained in:
Björn Geuken 2015-05-19 20:06:26 +02:00
parent c58585d445
commit 5a5745947d

View file

@ -162,13 +162,9 @@ class Conference < ActiveRecord::Base
# * +false+ -> If the CFP is not set or today isn't in the CFP period.
# * +true+ -> If today is in the CFP period.
def cfp_open?
today = Date.current
cfp = self.call_for_paper
if cfp && (cfp.start_date.. cfp.end_date).cover?(today)
return true
end
return false
cfp.present? && (cfp.start_date..cfp.end_date).cover?(Date.current)
end
##