As of Rails 4.0, support for attr_protected and attr_accessible in model classes is removed by default and placed in the protected_attributes gem. The new best practice is to restrict mass assignment in the controller using strong_parameters. The idea is that models should not be concerned with how their attributes are assigned to.
To speed the upgrade process to Rails 5.1, I'm temporarily using protected_attributes to maintain the old functionality, but this should be transitioned. Currently, we only use this in person.rb, so it shouldn't be a massively difficult transition.
As of Rails 4.0, support for
attr_protected
andattr_accessible
in model classes is removed by default and placed in theprotected_attributes
gem. The new best practice is to restrict mass assignment in the controller usingstrong_parameters
. The idea is that models should not be concerned with how their attributes are assigned to.To speed the upgrade process to Rails 5.1, I'm temporarily using
protected_attributes
to maintain the old functionality, but this should be transitioned. Currently, we only use this inperson.rb
, so it shouldn't be a massively difficult transition.