Skip to content

Setting the TimeZone in an initializer instead of application.rb has unexpected effect #24748

@zavan

Description

@zavan

Steps to reproduce

Instead of setting config.time_zone in application.rb (which works properly), create an initializer and set the timezone there with: Rails.application.config.time_zone = 'Brasilia'.

This works with other configurations, such as Rails.application.config.active_job.queue_adapter = :delayed_job, so it probably should work for setting the timezone too.

Expected behavior

When running Rails.application.config.time_zone the configured timezone is shown, and everything, including Time.zone, must be in the configured timezone.

Actual behavior

When running Rails.application.config.time_zone the configured timezone is shown, but everything, including Time.zone, is still UTC.

System configuration

Rails version:
master at f03c27c (Rails 5.0.0.beta3)

Ruby version:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions