Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10468 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

[PATCH] Define Duration#== (Ruby 1.9 compat)

Reported by: chuyeow Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: ruby 1.9 yarv
Cc: seank@nulogy.com

Description

Define an == instance method for ActiveSupport::Duration.

This defines an explicit object equality instance method that allows Durations to be compared against Numerics. Fixes tests that were failing in Ruby 1.9.

Attachments

define_equals_for_duration.diff (3.9 kB) - added by chuyeow on 12/11/07 14:14:34.

Change History

12/11/07 14:14:34 changed by chuyeow

  • attachment define_equals_for_duration.diff added.

12/11/07 14:16:04 changed by chuyeow

Replacing original attachment with one that removes trailing whitespace as well. And format private and protected methods with an indent like in the rest of the source.

12/11/07 23:48:12 changed by josh

All ActiveSupport test pass on Ruby 1.8.6.

This patch fixes the following tests under Ruby 1.9

* test_units(NumericExtTimeAndDateTimeTest)

* test_plus_with_time(DurationTest)

12/12/07 18:09:32 changed by sskirby

  • cc set to seank@nulogy.com.

12/15/07 02:36:51 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.