aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/tasks
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-03-28 01:45:04 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-03-28 01:45:04 +0000
commit480a7581d4ec87eb745b004d6e4daae98b52cfa5 (patch)
treef443e7c30fe41be65940c9119ce0cd24021d2baf /railties/lib/tasks
parentd8823d6fb7605788e6d61b3d5f67c0c7302527aa (diff)
downloadrails-480a7581d4ec87eb745b004d6e4daae98b52cfa5.tar.gz
rails-480a7581d4ec87eb745b004d6e4daae98b52cfa5.tar.bz2
rails-480a7581d4ec87eb745b004d6e4daae98b52cfa5.zip
Rails::Initializer#initialize_time_zone raises an error if value assigned to config.time_zone is not recognized. Rake time zone tasks only require ActiveSupport instead of entire environment
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9104 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r--railties/lib/tasks/misc.rake7
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/tasks/misc.rake b/railties/lib/tasks/misc.rake
index fcd860ae16..d083a8aef4 100644
--- a/railties/lib/tasks/misc.rake
+++ b/railties/lib/tasks/misc.rake
@@ -9,20 +9,21 @@ task :secret do
puts Rails::SecretKeyGenerator.new(ENV['ID']).generate_secret
end
+require 'active_support'
namespace :time do
namespace :zones do
desc 'Displays names of all time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
- task :all => :environment do
+ task :all do
build_time_zone_list(:all)
end
desc 'Displays names of US time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
- task :us => :environment do
+ task :us do
build_time_zone_list(:us_zones)
end
desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time'
- task :local => :environment do
+ task :local do
build_time_zone_list(:all, Time.now.beginning_of_year.utc_offset)
end