Get the latest record from a relation in a TextColumn

Hi, I'm trying to get the latest record from a relation in a TextColumn component, I can't find anything in the docs, has someone done something like this?
7 Replies
Dan Harrin
Dan Harrin15mo ago
maybe use a hasoneofmany relationship the downside is that you wont be able to make it sortable()
Javier Mercedes
Javier MercedesOP15mo ago
Well at the end I created an Attribute and enabled caching on it, I know is not elegant but it works XD
cheesegrits
cheesegrits15mo ago
Show your code, there may be a better way of doing it
Javier Mercedes
Javier MercedesOP15mo ago
The table doesn't have the created_at column so the logged_in_at column is the only one that I can sort
No description
Javier Mercedes
Javier MercedesOP15mo ago
Then I used the TextColumn to show it
Javier Mercedes
Javier MercedesOP15mo ago
No description
Javier Mercedes
Javier MercedesOP15mo ago
In the documentation nor checking the methods I didn't find any method to personalize the relation query to only get one record

Did you find this page helpful?