From 2dd2b70994dd63391342f6435a6268e3b8ed9b51 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Fri, 10 Oct 2014 18:44:26 -0700 Subject: [PATCH 1/2] *Don't* silence the deprecation warnings in test This is actually where we are most likely to see it (and we should try to deal with those as soon as possible, ideally when upgrading). --- config/environments/test.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index e63401fc8d7..b885d72ab32 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -40,7 +40,5 @@ Discourse::Application.configure do config.assets.compile = true config.assets.digest = false - # silence deprecation warnings in test config.eager_load = false - ActiveSupport::Deprecation.silenced = true end From 7ddf1df3e0fb640d2705424f53312119f8e09f06 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Fri, 10 Oct 2014 18:49:37 -0700 Subject: [PATCH 2/2] 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 8a08f3f514c..ce8c6b0241c 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