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 Harrin14mo ago
maybe use a hasoneofmany relationship the downside is that you wont be able to make it sortable()
Javier Mercedes
Javier MercedesOP14mo ago
Well at the end I created an Attribute and enabled caching on it, I know is not elegant but it works XD
cheesegrits
cheesegrits14mo ago
Show your code, there may be a better way of doing it
Javier Mercedes
Javier MercedesOP14mo 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 MercedesOP14mo ago
Then I used the TextColumn to show it
Javier Mercedes
Javier MercedesOP14mo ago
No description
Javier Mercedes
Javier MercedesOP14mo ago
In the documentation nor checking the methods I didn't find any method to personalize the relation query to only get one record
Want results from more Discord servers?
Add your server