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.

Use of #tap before requiring Active Support breaks on Ruby 1.8.6

#2603

Commit 945bf9c2 breaks Active Record on versions of Ruby that don't have a native #tap (like 1.8.6), because it tries to use #tap about two lines before Active Support is available :)

When I try to run the AR tests on OS X's 1.8.6p114, I get this:


/Users/chrisk/Documents/railstest/rails/activerecord/test/cases/../../lib/active_record.rb:24: undefined method `tap' for #<String:0x11ca1a0> (NoMethodError)

A simple fix is to go back to the previous way of handling the string, just using a local variable. This fixes the test suite for me. I've attached a patch.

Reported by Chris Kampmeier · May 4th, 2009 @ 02:12 AM

State: committed
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Anthony Crumley
    Anthony Crumley

    Here is a slightly different solution that eliminates the global variable but results in creating an extra array.

    May 4th, 2009 @ 06:21 AM

  2. Jeremy Kemper
    Jeremy Kemper
    • Assigned user set to Jeremy Kemper

    Oops :)

    May 4th, 2009 @ 04:33 PM

  3. Repository
    Repository
    • State changed from new to committed

    (from [d3ee8756c8b09b8524a9599926b02ededd27319c]) Don't use #tap before Active Support is available, since older versions of ruby don't have native implementations

    [#2603 Use of #tap before requiring Active Support breaks on Ruby 1.8.6 state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    May 4th, 2009 @ 04:36 PM