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.

Optional Exception on Mass-assignment of Protected Attributes

#1423

Originally squashed here: http://dev.rubyonrails.org/ticke...

What do you guys think of restoring this functionality, but defaulting to the current behavior? That is, have a configuration option that lets you turn on whiny mass-assignment of protected attributes, but by default it just does logger.debug with a warning. I know that during development I get bit by missing the debug messages way too often when adding fields and changing forms.

If there's interest I can patch it.

Reported by Nate · November 20th, 2008 @ 08:16 PM

State: duplicate
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Nate
    Nate

    Oh, and by interest I mean more interest than just me and the company I work for.

    November 20th, 2008 @ 08:19 PM

  2. Tammer Saleh
    Tammer Saleh

    +1

    The ARes argument is the first one I've heard for not raising on an attempt to mass-update a protected attribute, and it seems like somewhat of an edge case. Given the developer headache that can arise from silently ignoring protected attrs (we have had tons), I'd be in favor of defaulting to raising and having a silent option.

    November 20th, 2008 @ 08:44 PM

  3. Oliver Legg
    Oliver Legg

    +1

    I think this should be configurable, so that the behavior can be different depending on environment.

    This always bites me. I turn everything to protected by default and when using the console I try and use the short hand and I spend 5 minutes figuring our what I did wrong. Failing loudly would be preferable.

    December 3rd, 2008 @ 11:33 AM

  4. Nate
    Nate

    any input from core on this one?

    December 10th, 2008 @ 09:40 PM

  5. Brandon
    Brandon

    +1

    I'd love for raising to be the default, but getting the option would be a great start at least.

    December 10th, 2008 @ 09:41 PM

  6. Norbert Crombach
    Norbert Crombach

    +1

    The default is good, but I'd use this instead.

    December 10th, 2008 @ 10:00 PM

  7. Jeremy Kemper
    Jeremy Kemper

    This was on by default for a while, but caused widespread low-level pain. I'm not sure that turning it on and off application-wide will really help with that.

    December 10th, 2008 @ 10:45 PM

  8. Dan Pickett
    Dan Pickett

    +1 - I often overlook the debugging messages inadvertently.

    December 10th, 2008 @ 10:57 PM

  9. Pratik
    Pratik
    • Assigned user set to Jeremy Kemper

    March 12th, 2009 @ 04:32 PM

  10. Frederick Cheung