A platform for community discussion. Free, open, simple.
FIX: Requests were not being logged correctly
Robin Ward096eca0ee813
diff --git a/app/models/application_request.rb b/app/models/application_request.rbindex 52a6a8a87e0..3d0d8ae905f 100644--- a/app/models/application_request.rb+++ b/app/models/application_request.rb@@ -16,15 +16,16 @@ class ApplicationRequest < ActiveRecord::Baseinclude CachedCountingdef self.disable- @enabled = false+ @disabled = trueenddef self.enable- @enabled = true+ @disabled = falseenddef self.increment!(type, opts = nil)- perform_increment!(redis_key(type), opts) if @enabled+ return if @disabled+ perform_increment!(redis_key(type), opts)enddef self.write_cache!(date = nil)diff --git a/spec/rails_helper.rb b/spec/rails_helper.rbindex a0ce4b71b7d..cd235fedc92 100644--- a/spec/rails_helper.rb+++ b/spec/rails_helper.rb@@ -128,6 +128,9 @@ module TestSetup# code that runs inside jobs. run_later! means they are put on the redis# queue and never processed.Jobs.run_later!++ # Don't track ApplicationRequests in test mode unless opted in+ ApplicationRequest.disableendend