- Renamed checks for related records:
<associat>ful
form is now used instead of a passive one (<associat>ed
) to check for related records’ presence..<associat>ful
— scope records having associated ones.#<associat>ful?
— are there any records associated?
- Naming: improved passive forms for words ending with
or
/ant
/ion
/ment
/ing
.
- Checks for related records’ presence on roleless recursive associations:
.<associat>ful
— records having associated ones;.<association>less
— records not having associated ones;#<associat>ful?
— if there are records associated;#<association>less?
— if there are no records associated;#intermediate?
— whether is only one child record associated (Is the node just a link between two other nodes like?);#branching?
— whether are several child records associated.
- Naming: passive form for
author
.
roleless
scope used to generate wrong queries.
- DB constraints:
roles.name
isNOT NULL
,UNIQUE
constraints should treatNULLS
asNOT DISTINCT
.
- Roleless recursive associations used to fail on
joins
.
- Naming: improved passive forms a bit.
- Configuration: renamed
self_related
toself
.
- Checks for related records’ presence:
.<associat>ed
— records having associated ones;.<association>less
— records not having associated ones;#<associat>ed?
— if there are records associated;#<association>less?
— if there are no records associated.
- Documentation: self-targeted relationships in README.
- Documentation: examples in the README.
- Destroy orphaned relationships of an object on destroy.
- Symbolize configurable names used for associations, methods, etc.
- Raise
ArgumentError
for unknown names passed to the API.
Relationship[]
to filter relationships by related objects/classes.Role[]
acceptsHash
-like parameters to filter roles by relationships.- Methods for related records:
related?
to check for related objects,related
to fetch them,- and the basic
relationships
.
- Recursive methods for related records:
- flat
ancestors
&descendants
with distance, - based on
recursive
association scope.
- flat
roleless
scope for related records without a role.- A dedicated association for roleless children.
- Faulty scopes in role-based relationship associations.
- Naming for namespaced models, e.g., in Rails Engines.
Refactored from Rails Dynamic Associations.
Some experimental features are missing and can be found in the api
branch.