You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I am trying to write a query to filter by a relationship but I am having some issues
I have a Order model and a OrderStatus
the Order model hasManyOrderStatus
What I want to achieve is to be able to filter all the orders that have the latest status some status, for example placed
I managed to write this query, to get the latest status of the order when I preload the statuses, but the problem is that if a order gets a new status I will still get it in the results because in the past it had the status I am looking for. I need to filter based on the latest status
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I am trying to write a query to filter by a relationship but I am having some issues
I have a
Order
model and aOrderStatus
the
Order
modelhasMany
OrderStatus
What I want to achieve is to be able to filter all the orders that have the latest status some status, for example
placed
I managed to write this query, to get the latest status of the order when I preload the statuses, but the problem is that if a order gets a new status I will still get it in the results because in the past it had the status I am looking for. I need to filter based on the latest status
Beta Was this translation helpful? Give feedback.
All reactions