Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed #28198 -- Prevented model attributes from overriding deferred fields. #9126
Attributes from parent classes will not overload attributes in child classes. During model creation process, attributes which are dublicated in parent and child classes will be removed. That attributes will restored for all parent classes after model creation process
referenced this pull request
Nov 16, 2017
I'm not, as yet, convinced by this.
The root cause of the issue here comes from
It would be nice to address it there, rather than in
If we're going to remove and then replace attributes on parent classes,
we need tests to ensure that logic is correct.
I suggest extracting two methods, or helper functions, to encapsulate the logic
in the two added blocks.
Each of these can then have test cases demonstrating the expected behaviour, and
that it's correct. The two can also be tested together to demonstrate that the
replacement always works as expected.
In general, rather than actually removing/replacing attributes, could we merely
generate a list that could be checked against in