From 1c4db4d7c34a1062e998bbdee03e992c4c5bff6d Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Wed, 16 Mar 2011 09:43:14 -0400 Subject: Raise on invalid timezone Signed-off-by: Santiago Pastorino --- activesupport/lib/active_support/railtie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/railtie.rb') diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index c2deba3b1b..910e9640d1 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -46,7 +46,7 @@ module ActiveSupport # If assigned value cannot be matched to a TimeZone, an exception will be raised. initializer "active_support.initialize_time_zone" do |app| require 'active_support/core_ext/time/zones' - zone_default = Time.__send__(:get_zone, app.config.time_zone) + zone_default = Time.__send__(:get_zone, app.config.time_zone) rescue nil unless zone_default raise \ -- cgit v1.2.3 From e9020b4b5dbd4a19e288c613a86c78e32010c361 Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Tue, 5 Apr 2011 00:33:29 +0200 Subject: added find_zone and find_zone! to AS timezones and changed the AS Railtie to use find_zone! as well as adding Railtie tests Signed-off-by: Santiago Pastorino --- activesupport/lib/active_support/railtie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/railtie.rb') diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index 910e9640d1..04df2ea562 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -46,7 +46,7 @@ module ActiveSupport # If assigned value cannot be matched to a TimeZone, an exception will be raised. initializer "active_support.initialize_time_zone" do |app| require 'active_support/core_ext/time/zones' - zone_default = Time.__send__(:get_zone, app.config.time_zone) rescue nil + zone_default = Time.find_zone!(app.config.time_zone) unless zone_default raise \ -- cgit v1.2.3