https://avo.cool logo
Hi guys, there is a way to change all orderging...
# avo-2
v
Hi guys, there is a way to change all orderging from resources inside a has_many field? I would like to change the default order from all my has_many fields, but I didnt find anything on documentation, I triyed to change my resolve_query_scope but works only in index pages I'm using 2.51 version
m
Thread automatically created by thiagão in #740893011994738751
l
v
@lemon-wall-20836 it's possible to add a global scope for all has_many fields?
like
relation.order(created_at: :desc)
i'm trying to implement some concern to include on
AssociationsCotnroller
but without sucess
because I have a lot of has_many fields and I want to change all to order by created_at desc
oh, I managed to adjust here with a concern included on AssociationsController
thanks Adrian!