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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
, andsubclass_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.