Skip to content

Commit

Permalink
Fix NoMethodError: undefined method `hour' for 1:Integer
Browse files Browse the repository at this point in the history
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 alphagov/static#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]: alphagov/static#2379
[Feedback]: #1149
[usage]: https://github.com/alphagov/feedback/blob/1cfe51bc39ec48f2cba0c502b15720fdc4dbbcd2/config/environments/test.rb#L14
  • Loading branch information
ChrisBAshton committed Jan 12, 2021
1 parent dcfd54f commit 0e78af3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e78af3

Please sign in to comment.