Changeset 8885
- Timestamp:
- 02/16/08 23:39:40 (8 months ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/time/calculations.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/time_ext_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r8884 r8885 1 1 *SVN* 2 3 * Time.=== returns true for TimeWithZone instances [Geoff Buesing] 2 4 3 5 * TimeWithZone #+ and #- behave consistently with numeric arguments regardless of whether wrapped time is a Time or DateTime; consistenty answers false to #acts_like?(:date) [Geoff Buesing] trunk/activesupport/lib/active_support/core_ext/time/calculations.rb
r8730 r8885 25 25 26 26 module ClassMethods 27 # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances 28 def ===(other) 29 other.is_a?(::Time) 30 end 31 27 32 # Return the number of days in the given month. 28 33 # If no year is specified, it will use the current year. trunk/activesupport/test/core_ext/time_ext_test.rb
r8806 r8885 469 469 end 470 470 471 def test_case_equality 472 assert Time === Time.utc(2000) 473 assert Time === ActiveSupport::TimeWithZone.new(Time.utc(2000), TimeZone['UTC']) 474 assert_equal false, Time === DateTime.civil(2000) 475 end 476 471 477 protected 472 478 def with_env_tz(new_tz = 'US/Eastern')