Attr_accessible - plugins information, action required

Hi foreman devs - particularly plugin authors this time,

As part of the Rails 4 upgrade, we are moving to attr_accessible to
enforce mass assignment protection on Rails models. We want to merge
this a bit before than Rails 4 itself.

If your plugin extends Foreman models and uses mass assignment on the
attributes it extends, you will need to whitelist these in your plugin.

I made a few pull requests to projects where I saw some failures:

Katello - Refs #12468 - Add attr_acccessible to organization label by dLobatog · Pull Request #5615 · Katello/katello · GitHub
Discovery - Fixes #12548 - Allow discovery_rule to be mass assigned by dLobatog · Pull Request #233 · theforeman/foreman_discovery · GitHub
Salt - Fixes #12549 - Allow salt-proxy and salt_environment to be mass-assigned by dLobatog · Pull Request #55 · theforeman/foreman_salt · GitHub

As a secondary reminder - Tom Caspy gave yesterday an overview of
changes on Rails 4 that you probably want to be aware if you're
developing a plugin - https://youtu.be/RCqwTtIXRSw?t=28m32s

Thanks!

··· -- Daniel Lobato Garcia

@dLobatog

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: elobato (Daniel Lobato Garcia) | Keybase

The Foreman PR's been merged, so please check your tests status and
whitelist additional attributes on core models where required.


Dominic Cleal
dominic@cleal.org

··· On 20/11/15 10:38, Daniel Lobato Garcia wrote: > Hi foreman devs - particularly plugin authors this time, > > As part of the Rails 4 upgrade, we are moving to attr_accessible > to enforce mass assignment protection on Rails models. We want to > merge this a bit before than Rails 4 itself. > > https://github.com/theforeman/foreman/pull/2922 > > If your plugin extends Foreman models and uses mass assignment on > the attributes it extends, you will need to whitelist these in your > plugin. > > I made a few pull requests to projects where I saw some failures: > > Katello - https://github.com/Katello/katello/pull/5615 Discovery - > https://github.com/theforeman/foreman_discovery/pull/233 Salt - > https://github.com/theforeman/foreman_salt/pull/55