From 0e78af3a3f244c05376d495077cf4d181adc85f7 Mon Sep 17 00:00:00 2001 From: ChrisBAshton Date: Tue, 12 Jan 2021 08:59:17 +0000 Subject: [PATCH] Fix NoMethodError: undefined method `hour' for 1:Integer We have to `require "active_support/time"` to define the helper methods we use to set the Cache-Control header in the [test environment][usage]. I don't know why bumping the govuk_publishing_components gem from v23.10.1 to v23.12.1 has caused this issue in both [Static][] and [Feedback][] (nor why the tests passed on the PR and only subsequently failed after merge). I write up an investigation in https://github.com/alphagov/static/pull/2384, but have nothing conclusive. It won't be a good use of time to investigate too much further, so I'm happy that this is a harmless change which unblocks us from deploying an important fix. Trello: https://trello.com/c/YhIIykse/2291-3-fix-cross-site-scripting-vulnerabilities [Static]: https://github.com/alphagov/static/pull/2379 [Feedback]: https://github.com/alphagov/feedback/pull/1149 [usage]: https://github.com/alphagov/feedback/blob/1cfe51bc39ec48f2cba0c502b15720fdc4dbbcd2/config/environments/test.rb#L14 --- config/application.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/application.rb b/config/application.rb index 69732d91..77f983f0 100644 --- a/config/application.rb +++ b/config/application.rb @@ -3,6 +3,7 @@ require "rails" require "action_controller/railtie" require "action_mailer/railtie" +require "active_support/time" require "sprockets/railtie" Bundler.require(*Rails.groups)