Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fix inheritance_column attr isn't protected #11

Merged
merged 1 commit into from
Oct 15, 2018
Merged

Fix inheritance_column attr isn't protected #11

merged 1 commit into from
Oct 15, 2018

Conversation

bogdanvlviv
Copy link
Contributor

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 rails/rails@3da890f

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.

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 rails/rails@3da890f

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 westonganger merged commit bf7a82a into westonganger:master Oct 15, 2018
@westonganger
Copy link
Owner

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

@bogdanvlviv bogdanvlviv deleted the rails-5-0 branch October 15, 2018 18:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants