From 0fac15cd22743260b498cdcf9b8ea1ea122b5d25 Mon Sep 17 00:00:00 2001 From: anvyzhang Date: Fri, 20 Nov 2015 10:42:08 +0800 Subject: [PATCH] No need to check if rucaptcha_at is blank since (Time.now.to_i - 0) should always biger than 120 --- lib/rucaptcha/controller_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rucaptcha/controller_helpers.rb b/lib/rucaptcha/controller_helpers.rb index bb00734..845551f 100644 --- a/lib/rucaptcha/controller_helpers.rb +++ b/lib/rucaptcha/controller_helpers.rb @@ -16,7 +16,7 @@ module RuCaptcha def verify_rucaptcha?(resource = nil) rucaptcha_at = session[:_rucaptcha_at].to_i # Captcha chars in Session expire in 2 minutes - if rucaptcha_at.blank? || (Time.now.to_i - rucaptcha_at) > 120 + if (Time.now.to_i - rucaptcha_at) > 120 return false end