Embed `has_one` relationship into resource
Let's say I have a resource A.
It has relationship:
which holds some fields that should be versioned if any changes happen, it has at least one
Let's say the
We can define the manual fake "has_one" relationship, by making a query that takes the latest version of
Now, here's question. Is there any way to embed the fields from the latest
- Accessed at top-level like
- Loaded automatically
as if they were attributes of the
It has relationship:
which holds some fields that should be versioned if any changes happen, it has at least one
:a_versionLet's say the
AVersion has the a :price attribute.We can define the manual fake "has_one" relationship, by making a query that takes the latest version of
AVersion.Now, here's question. Is there any way to embed the fields from the latest
AVersion from the fake "has_one" manual relationship into A so that they can be:- Accessed at top-level like
A.price - Loaded automatically
as if they were attributes of the
A itself?