Closed josh-m-sharpe closed 9 years ago
For anyone interested, I 'fixed' this issue by adding this in an initializer:
class ProtectedAttributes::Railtie def initializers_for [] end end
Can't you just set config.active_record.whitelist_attributes
to false in your application?
@rafaelfranca yes :/
The default is true since some patch version of 3.2, this gem is just using the same default.
Isn't this a regression?
https://github.com/rails/protected_attributes/blob/master/lib/protected_attributes/railtie.rb#L10-L15
In rails 3 attr_accessible was not added to all models, but with this gem, in rails 4, it is... Sure, this might be a "Best practice" but I thought this gem was supposed to be a kludge to keep the same behavior that was supported in rails 3 around in rails 4 - which helps support the upgrade path.
Now, with this gem, that behavior has changed. So updating a legacy rails 3 app to rails 4 forces breaking changes.
Should this new behavior be configurable?