From 5a5745947d24219db0a05ad927438bd7c0914358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= Date: Tue, 19 May 2015 20:06:26 +0200 Subject: [PATCH] Simplify cfp_open? method --- app/models/conference.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index 58e8b3ef..fcc4aa6e 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -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 ##