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
maybe use a hasoneofmany relationship
the downside is that you wont be able to make it sortable()
Well at the end I created an Attribute and enabled caching on it, I know is not elegant but it works XD
Show your code, there may be a better way of doing it
The table doesn't have the created_at column so the logged_in_at column is the only one that I can sort
Then I used the TextColumn to show it
In the documentation nor checking the methods I didn't find any method to personalize the relation query to only get one record