Changeset 9104
- Timestamp:
- 03/28/08 01:45:04 (3 months ago)
- Files:
-
- trunk/railties/CHANGELOG (modified) (1 diff)
- trunk/railties/lib/initializer.rb (modified) (1 diff)
- trunk/railties/lib/tasks/misc.rake (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/railties/CHANGELOG
r9102 r9104 1 1 *SVN* 2 3 * 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 [Geoff Buesing] 2 4 3 5 * Stop adding the antiquated test/mocks/* directories and only add them to the path if they're still there for legacy reasons [DHH] trunk/railties/lib/initializer.rb
r9102 r9104 350 350 end 351 351 352 # Sets the default value for Time.zone, and turns on ActiveRecord time_zone_aware_attributes. 353 # If assigned value cannot be matched to a TimeZone, an exception will be raised. 352 354 def initialize_time_zone 353 355 if configuration.time_zone 354 Time.zone_default = TimeZone[configuration.time_zone] 356 zone_default = TimeZone[configuration.time_zone] 357 unless zone_default 358 raise "Value assigned to config.time_zone not recognized. Run `rake -D time` for a list of tasks for finding appropriate time zone names." 359 end 360 Time.zone_default = zone_default 355 361 if configuration.frameworks.include?(:active_record) 356 362 ActiveRecord::Base.time_zone_aware_attributes = true trunk/railties/lib/tasks/misc.rake
r9074 r9104 10 10 end 11 11 12 require 'active_support' 12 13 namespace :time do 13 14 namespace :zones do 14 15 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' 15 task :all => :environmentdo16 task :all do 16 17 build_time_zone_list(:all) 17 18 end 18 19 19 20 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' 20 task :us => :environmentdo21 task :us do 21 22 build_time_zone_list(:us_zones) 22 23 end 23 24 24 25 desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time' 25 task :local => :environmentdo26 task :local do 26 27 build_time_zone_list(:all, Time.now.beginning_of_year.utc_offset) 27 28 end