Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

Amiel Martin's latest activity

Thursday, February 26 2009
2067 Numeric::Time is not consistent, giving confusing results to Duration#inspect was updated in Ruby on Rails
  • Amiel Martin
    Amiel Martin commented at 6:52 AM

    So, what would be the best action here? I'd love to contribute, and I think having a way to output a duration in human readable form would be a good feature.

Wednesday, February 25 2009
2067 Numeric::Time is not consistent, giving confusing results to Duration#inspect was updated in Ruby on Rails
  • Amiel Martin
    Amiel Martin commented at 6:09 AM

    or, maybe this would be better

    
    >> 5.seconds + 1.minute
    => 65 seconds
    >> _.humanize
    => "1 minute and 5 seconds"
    

    I'm happy to implement any of the above, ...

  • Amiel Martin
    • Title changed from Numeric::Time is not consistent giving confusing results to Duration#inspect to Numeric::Time is not consistent, giving confusing results to Duration#inspect
    by Amiel Martin at 6:05 AM
  • Amiel Martin
    Amiel Martin commented at 6:04 AM

    another idea is to write a method in ActiveSupport::Duration that "normalizes" internal data.

    
    # example
    >> 65.seconds
    => 65 seconds
    >> 65.seconds.parts
    =...
  • Amiel Martin
    Amiel Martin created the ticket at 5:34 AM

    Is there a reason that ActiveSupport::CoreExtensions::Numeric::Time#minutes (and hours) don't their own unit as a type when creating an ActiveSupport::Duration ...