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.

Remove 'Object#send!'

#945

'Object#send!', as defined in active_support/core_ext/object/misc.rb, was originally added because Ruby 1.9 has such a method as well. Object#send! has been removed from Ruby 1.9 since November 2007.

Furthermore, using 'Object#send!' can break Delegate classes such as Tempfile, though it depends on the load order. Delegate delegates all methods to its underlying object. If Object#send! is defined before Tempfile was defined, then Tempfile will think that its underlying File object has a 'send!' method. Thus, calling Tempfile#send!(:size) will result in Tempfile calling File#send!(:size). File#size doesn't exist, so a crash will occur as a result. What should have happened is that Tempfile#size is called. But since Object#send! was defined before Tempfile was defined, Tempfile (or rather, Delegate) will override 'send!' and replace it with a version that forwards the call to File.

The attached patch removes 'Object#send!'.

Reported by Hongli Lai · August 31st, 2008 @ 06:25 PM

State: resolved
Milestone: none
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none