Module: GovukTimezone

Defined in:
lib/govuk_app_config/govuk_timezone.rb

Class Method Summary collapse

Class Method Details

.configure(config) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/govuk_app_config/govuk_timezone.rb', line 2

def self.configure(config)
  raise "govuk_app_config prevents configuring time_zone with config.time_zone - use config.govuk_time_zone instead" unless config.time_zone == "UTC"

  if config.respond_to?(:govuk_time_zone) && config.govuk_time_zone.present?
    config.time_zone = config.govuk_time_zone
  else
    Rails.logger.info 'govuk_app_config changing time_zone from UTC (the rails default) to London (the GOV.UK default). Set config.govuk_time_zone = "UTC" if you need UTC.'
    config.time_zone = "London"
  end
end