From bc966259fb15737de57ef6d2298b6c615726d031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= Date: Thu, 21 May 2015 18:53:27 +0200 Subject: [PATCH] Refactor registration_dates_given? --- app/models/conference.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index 9c1cde4a..13c99f8c 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -155,11 +155,9 @@ class Conference < ActiveRecord::Base # * +false+ -> If the conference registration dates are not set # * +true+ -> If conference registration dates are set def registration_dates_given? - if registration_period.nil? || (registration_period.start_date.blank? || registration_period.end_date.blank?) - false - else - true - end + registration_period.present? && + registration_period.start_date.present? && + registration_period.end_date.present? end ##