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.

Dan Barry's latest activity

Saturday, August 01 2009
2957 Adding Array.uniq_by(proc) to core_ext, allowing selection of unique elements... was updated in Ruby on Rails
  • Dan Barry
    Dan Barry commented at 9:53 PM

    Joey's implementation O(n^3 / m) where n is the number of elements in the array and m is the number of unique values. I came up with a different implementation ...

Wednesday, March 04 2009
2113 XmlSerializer uses deprecated Object#type was updated in Ruby on Rails
  • Dan Barry
    Dan Barry commented at 2:49 PM

    I realize that Column#type and Object#class are different: that's why the patch checks if it's a column and uses #type if it is.

    I get a deprecation warning on ...

Tuesday, March 03 2009
2113 XmlSerializer uses deprecated Object#type was created in Ruby on Rails
  • Dan Barry
    Dan Barry created the ticket at 1:36 AM

    XmlSerializer uses Object#type, which is deprecated.

Friday, February 13 2009
1916 ActiveSupport::Duration#* should return a Duration, not an Integer was updated in Ruby on Rails
  • Dan Barry
    Dan Barry commented at 8:18 PM

    Ah, good catch. I'll have to update the tests and figure that out.

Monday, February 09 2009
1916 ActiveSupport::Duration#* should return a Duration, not an Integer was updated in Ruby on Rails
  • Dan Barry
    Dan Barry commented at 1:04 AM

    Actually, this does make 2 * 1.day return a duration. I don't know exactly why it works, but there's a test for it (test_multiplication_associativity).

Monday, January 19 2009
879 Finding the days/weeks/months/years between two dates was updated in Ruby on Rails
  • Dan Barry
    Dan Barry commented at 8:40 PM

    AnchoredDuration sounds like a great idea. It could have built in #years, #months, etc., and also allow division by a Duration. So, you could do

    
    ActiveSuppor...
  • Dan Barry
    Dan Barry commented at 5:59 PM

    The numbering on my comments should 1, 2, 4, 5, 6, but the markdown interpreter converted them to an ol and they got reordered 1, 2, 3, 4, 1. So, my 3rd respons...

  • Dan Barry
    Dan Barry commented at 5:54 PM

    @Geoff

    1. I'm not sure if this should return negative or absolute values. To me, "between two dates" sounds like it would be absolute, but "between the start dat...

Monday, January 05 2009
1280 error_messages_for doesn't html escape it's messages was updated in Ruby on Rails
  • Dan Barry
    Dan Barry commented at 8:03 PM

    I've attached the corresponding patch for error_message_on.

    Also tested that Inge's patch still applies cleanly, and it does.

Monday, October 13 2008
879 Finding the days/weeks/months/years between two dates was updated in Ruby on Rails
  • Dan Barry
    Dan Barry commented at 4:15 AM

    I've added * and / to duration, so I was able to optimize these calculations. A new patch has been attached with the optimizations.