This project is archived and is in readonly mode.

#5498 ✓resolved
Godfrey Chan

ActiveSupport::Duration is not properly delegating to its value

Reported by Godfrey Chan | August 30th, 2010 @ 03:09 PM

http://github.com/rails/rails/blob/master/activesupport/lib/active_...

Line 102 should probably be value.send(method, *args, &block)... In the current code anything which requires a block won't work properly. For instance, 1.day.times { puts 'Hello' } returns an Enumerator instead of doing what you expected. Now maybe it doesn't make sense to call times on a duration, but point being anything that requires a block won't work.

If this is for some odd reason the right behaviour it really should be documented in the code.

I'm in a hurry now so if someone could attach the tests and patches for this it'd be great. Otherwise I'll do it tonight.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages