This project is archived and is in readonly mode.

#3033 ✓resolved
Bryan Helmkamp

Regression on 2.3 branch: Allow delegating methods to nil

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

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

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Tags

Pages