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.

Class Attribute setter method doesn't return set value

#5323

The setter method for class attributes does not return the value that is set. This means that in cases where you use something like send(:attr=, VAL), the value returned from your send call is not actually VAL. Though I couldn't find any other documentation of this problem, I did run into a place where attribute protection was actually giving me problems that were fixed by this bug. Either way, this seems like a simple and sane fix. The included test helps to explain what the issue is.

Reported by Peter Wagenet · August 6th, 2010 @ 09:05 PM

State: stale
Milestone: 3.1
Assigned to: Santiago Pastorino Santiago Pastorino
Importance: Low

Activity

  1. rgoytacaz (at gmail)
    rgoytacaz (at gmail)
    • Assigned user set to Santiago Pastorino

    I've tested this through 1.8.7 and 1.9.2.

    It seems that the problem and confusion is related to the way the class was created. I don't know if they should behave differently though.

    I've created tests that exposes those differences.

    I can say that they indeed behave differently, although I don't know if its intended.

    Since it has to do with creating a class passing a block to it(thus the difference that makes it return a proc object instead of the evaluation of the method on #send), I don't even know if this applies to rails.

    []'s Rodrigo Dellacqua

    August 11th, 2010 @ 06:53 AM

  2. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Milestone set to 3.1
    • Importance changed from to Low

    February 2nd, 2011 @ 08:07 PM

  3. rails
    rails

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    May 3rd, 2011 @ 01:00 AM

  4. rails
    rails
    • State changed from open to stale

    May 3rd, 2011 @ 01:00 AM