This project is archived and is in readonly mode.
Optional Exception on Mass-assignment of Protected Attributes
-
Nate
Oh, and by interest I mean more interest than just me and the company I work for.
-
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.
-
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.
-
Nate
any input from core on this one?
-
Brandon
+1
I'd love for raising to be the default, but getting the option would be a great start at least.
-
Norbert Crombach
+1
The default is good, but I'd use this instead.
-
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.
-
Dan Pickett
+1 - I often overlook the debugging messages inadvertently.
-
Pratik
- Assigned user set to Jeremy Kemper
-
Frederick Cheung
- State changed from new to duplicate
#2388 feature patch: config.active_record.raise_on_illegal_mass_assignment option has a patch implementing this