From d93317534ca6350ae9f8a9f285250e5b63728ba3 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Thu, 8 Jun 2017 08:43:27 +0900 Subject: Remove unreachable code `Time.find_zone!` raise `ArgumentError` if invalid value is specified. https://github.com/rails/rails/blob/379a0b42daf0d8e14130db7fd886d05d8d88e3f2/activesupport/lib/active_support/core_ext/time/zones.rb#L97..L99 Therefore, the return value never becomes nil. --- activesupport/lib/active_support/railtie.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index 1b4ecf4d72..af1d5bd615 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -28,14 +28,7 @@ module ActiveSupport raise e.exception "tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install" end require "active_support/core_ext/time/zones" - zone_default = Time.find_zone!(app.config.time_zone) - - unless zone_default - raise "Value assigned to config.time_zone not recognized. " \ - 'Run "rake time:zones:all" for a time zone names list.' - end - - Time.zone_default = zone_default + Time.zone_default = Time.find_zone!(app.config.time_zone) end # Sets the default week start -- cgit v1.2.3