cwru-hvz-core / cwru-hvz-source

Case Western's Implementation of a Humans vs. Zombies tracking engine.
http://hvz.case.edu/
10 stars 9 forks source link

Replace protected_attributes with strong_parameters #107

Open jameshochadel opened 7 years ago

jameshochadel commented 7 years ago

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.