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.

ActiveRecord attributes should respect access control

#1084

From a discussion on this thread: http://groups.google.com/group/r...

This patch makes possible setting ActiveRecord attributes as private. #respond_to? will now return false for an attribute method defined as private in the class definition. Also, attempting to directly call the attribute method will result in a NoMethodError. Calling the method via #send circumvents the access control, as expected.

Tests included.

Reported by Adam Milligan · September 21st, 2008 @ 09:27 AM

State: committed
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Michael Koziarski
    Michael Koziarski
    • Assigned user set to Michael Koziarski
    • Milestone cleared.

    September 21st, 2008 @ 05:56 PM

  2. Michael Koziarski
    Michael Koziarski
    • Assigned user changed from Michael Koziarski to Pratik

    OK, I think this looks ok but I'd appreciate someone else's eyes over it too.

    Pratik, does this look ok to you?

    September 24th, 2008 @ 06:04 PM

  3. Repository
    Repository
    • State changed from new to committed

    (from [4d9a7ab5f5c28820e0b076f9ca44bdd20e19e6ea]) Changed ActiveRecord attributes to respect access control.

    Signed-off-by: Michael Koziarski michael@koziarski.com [#1084 ActiveRecord attributes should respect access control state:committed] http://github.com/rails/rails/co...

    September 24th, 2008 @ 06:41 PM

  4. Adam Milligan
    Adam Milligan

    This patch is actually the second of two patches based on the same rails-core group thread. I submitted the first at http://rails.lighthouseapp.com/p... .

    I just mention this because the first patch hasn't received any attention, while his has been committed. I thought perhaps its existence got lost in the long discussion thread.

    September 26th, 2008 @ 06:39 AM