Fix single table inheritance deprecation warning bug #84
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.
This fix prevents the deprecation warning
Entities was manually included in a model
from being raised when using single table inheritance. The warning was being raised because theDfE::Analytics::Entities
module gets included in all the entity model classes.I noticed we were still getting deprecation warnings after this PR got merged: DFE-Digital/apply-for-teacher-training#8374
Looking into the code it seems that once the first include runs, all the following classes in that group already have the model included. I initially thought that it gets included in the parent class, but that doesn't seem to be the case.
I also removed the
@shown_deprecation_warning
instance variable as it wasn't serving any purpose.Tagging @duncanjbrown @JR-G here as I don't have access to this repo