This project is archived and is in readonly mode.

#2431 ✓resolved
Michael Siebert

deprecate fails on methods ending with equal sign

Reported by Michael Siebert | April 6th, 2009 @ 07:03 PM | in 2.x

it is not possible to deprecate methods that end with "=" using ActiveSupport::Deprecation.


class Foo
 attr_accessor bar
 deprecate :bar=
end

this throws the following error:


active_support/deprecation.rb:100:in `deprecate': compile error (SyntaxError)
activesupport/lib/active_support/deprecation.rb:99: syntax error, unexpected ',', expecting '='

this is because Foo.foo=(*bar) is not valid ruby syntax. The fix is to use send instead.

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>

Referenced by

Pages