westonganger / protected_attributes_continued

The community continued version of protected_attributes for Rails 5+
MIT License
45 stars 33 forks source link

Fix `inheritance_column` attr isn't protected #11

Closed bogdanvlviv closed 6 years ago

bogdanvlviv commented 6 years ago

During upgrade Rails from 4.2 to 5.0 I'd got a test failure that show that inheritance_column attr isn't protected anymore.

After debugging I found that we have overridden subclass_from_attributes? to protect that column. Since Rails 5.0 that method is removed from Rails codebase that causess that issue, see https://github.com/rails/rails/commit/3da890f891b116218c10d9b049dba23d15d416cf

In order to fix this bug we should override subclass_from_attributes instead.

Overriding of subclass_from_attributes?, and subclass_from_attrs should be removed since protected_attributes_continued dropped support of Rails < 5, see https://github.com/Current-RMS/protected_attributes_continued/blob/master/CHANGELOG.md#130

Since it is security fix I think we should release 1.3.1 with that fix too.

westonganger commented 6 years ago

Awesome thank you for this. Sorry for the delay, turns out I had my GitHub emails turned off.