Actions
Improvement #159
closedAdd validations for self-related associations
Start date:
02/12/2021
Due date:
% Done:
100%
Estimated time:
Compatible Redmine Version:
Pull Request Link:
Description
Self-related Relation¶
A relation between two objects of the same model (ProjectType or Project) is defined as ordered pair:
(a,b) != (b,a)
The left object of the pair is the superordinate (guest) and the right object is the subordinate (host).
- Project types uses superordinate and subordinate notation.
- Projects uses guest and host notation.
Resulting Rules concerning Data Persistence¶
- An object cannot have a relation to itself:
(a,a) or (b,b)
. - An oject cannot have a subordinated relation to its superordinated object, what would cause a circular reference:
(a,b) and (b,a)
. That is, a relation is either(a,b) or (b,a)
, but not both. The preferred definition, what should be saved, is from superordinated object to subordinated object. - The pair
(a,b)
is uniqe.
Actions