This project is archived and is in readonly mode.

#5323 ✓stale
Peter Wagenet

Class Attribute setter method doesn't return set value

Reported by Peter Wagenet | August 6th, 2010 @ 09:05 PM | in 3.1

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.

Comments and changes to this ticket

  • rgoytacaz (at gmail)

    rgoytacaz (at gmail) August 11th, 2010 @ 06:53 AM

    • 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

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 08:07 PM

    • State changed from “new” to “open”
    • Milestone set to 3.1
    • Importance changed from “” to “Low”
  • rails

    rails May 3rd, 2011 @ 01:00 AM

    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.

  • rails

    rails May 3rd, 2011 @ 01:00 AM

    • State changed from “open” to “stale”

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>

Attachments

Pages