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.

Regression on 2.3 branch: Allow delegating methods to nil

#3033

ActiveSupport's #delegate feature doesn't handle delegating to nil well, and there was recently a regression in this commit to add better exceptions: http://github.com/rails/rails/commit/63cc6b7242993a5c4d96df4479a4ad...

The patch improves behavior for both the allow_nil and the non-allow_nil cases, where methods that actually exist on nil will be called properly.

Patch with tests is here: http://github.com/brynary/rails/tree/delegate-to-nil

Reported by Bryan Helmkamp · August 10th, 2009 @ 11:38 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
  2. Bryan Helmkamp
    Bryan Helmkamp

    This is fixed in master, and I believe it can be closed out.

    September 25th, 2009 @ 03:21 PM

  3. Elad Meidar
    Elad Meidar

    Bryan, can you supply a patch within a single file? please ? :)

    September 26th, 2009 @ 02:25 AM

  4. Rizwan Reza
    Rizwan Reza

    This can be closed, as Bryan already said.

    January 17th, 2010 @ 06:42 PM

  5. Pratik
    Pratik
    • State changed from new to resolved

    January 17th, 2010 @ 07:01 PM