Changeset 8708
- Timestamp:
- 01/23/08 18:49:54 (7 months ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/time/zones.rb (modified) (2 diffs)
- trunk/activesupport/test/core_ext/time_with_zone_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r8705 r8708 1 1 *SVN* 2 3 * Time #in_current_time_zone and #change_time_zone_to_current return self when Time.zone is nil [Geoff Buesing] 2 4 3 5 * Remove unneeded #to_datetime_default_s alias for DateTime#to_s, given that we inherit a #to_default_s from Date that does exactly the same thing [Geoff Buesing] trunk/activesupport/lib/active_support/core_ext/time/zones.rb
r8696 r8708 47 47 # Returns the simultaneous time in Time.zone 48 48 def in_current_time_zone 49 in_time_zone(::Time.zone)49 ::Time.zone ? in_time_zone(::Time.zone) : self 50 50 end 51 51 … … 61 61 # Replaces the existing zone to Time.zone; leaves time value intact 62 62 def change_time_zone_to_current 63 change_time_zone(::Time.zone)63 ::Time.zone ? change_time_zone(::Time.zone) : self 64 64 end 65 65 end trunk/activesupport/test/core_ext/time_with_zone_test.rb
r8696 r8708 171 171 end 172 172 with_time_zone nil do 173 assert_equal 'Sat, 01 Jan 2000 00:00:00 UTC +00:00', @t.in_current_time_zone.inspect174 assert_equal 'Sat, 01 Jan 2000 00:00:00 UTC +00:00', @dt.in_current_time_zone.inspect173 assert_equal @t, @t.in_current_time_zone 174 assert_equal @dt, @dt.in_current_time_zone 175 175 end 176 176 end … … 197 197 end 198 198 with_time_zone nil do 199 assert_equal 'Sat, 01 Jan 2000 00:00:00 UTC +00:00', @t.change_time_zone_to_current.inspect200 assert_equal 'Sat, 01 Jan 2000 00:00:00 UTC +00:00', @dt.change_time_zone_to_current.inspect199 assert_equal @t, @t.change_time_zone_to_current 200 assert_equal @dt, @dt.change_time_zone_to_current 201 201 end 202 202 end