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.

This project is archived and is in readonly mode.

Bug In #method_missing For AssociationCollection's Dynamic #create_by_ For 1.8.6

#5188

While using RVM to test an old ruby 1.8.6-p388 on our production servers, I noticed that the create_by_ dynamic method blows up due to how Hash[] args are processed. For instance,

1.8.6

>> Hash[[["post_id", 42], ["skimmer", false]]]
ArgumentError: odd number of arguments for Hash
    from (irb):14:in `[]'
    from (irb):14

1.8.7 & Up

>> Hash[[["post_id", 42], ["skimmer", false]]]
=> {"post_id"=>42, "skimmer"=>false}

The attached patch is not pretty, but it does work the same for all ruby versions. Thoughts on how to make this cleaner? The patch is applied against 2-3-stable and tested under 1.8.6/1.8.7/1.9.1. BTW, there are no tests in this because 4 tests already failed as a result of this.

Reported by Ken Collins · July 23rd, 2010 @ 09:04 PM

State: committed
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Ken Collins
    Ken Collins
    • Tag changed from ruby 1.8.6, 1.8.6, 2-3-stable to ruby 1.8.6, 1.8.6, 2-3-stable, 2.3.9

    There tests are still failing and with 2.3.9 around the corner, should this really be fixed soon?

    http://gist.github.com/560793

    September 1st, 2010 @ 03:54 PM

  2. Ken Collins
    Ken Collins

    Here is another patch that fix this and other paren warnings too.

    September 1st, 2010 @ 04:16 PM

  3. Michael Koziarski
    Michael Koziarski
    • State changed from new to committed
    • Importance changed from to Low

    applied!

    September 3rd, 2010 @ 03:41 AM