From 7ddf1df3e0fb640d2705424f53312119f8e09f06 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Fri, 10 Oct 2014 18:49:37 -0700 Subject: [PATCH] FIX: honor `email_token_grace_period_hours` setting correctly The documentation said that the unit for this setting is in *hours*, but the code is treating it as *seconds*. Also, `Numeric#ago` has been deprecated since Rails 4.1 (precisely to help prevent these kind of bugs) and will go away in Rails 4.2. --- app/models/email_token.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/email_token.rb b/app/models/email_token.rb index 8a08f3f51..ce8c6b024 100644 --- a/app/models/email_token.rb +++ b/app/models/email_token.rb @@ -22,7 +22,7 @@ class EmailToken < ActiveRecord::Base end def self.confirm_valid_after - SiteSetting.email_token_grace_period_hours.ago + SiteSetting.email_token_grace_period_hours.hours.ago end def self.unconfirmed