activerecord-multi-tenant icon indicating copy to clipboard operation
activerecord-multi-tenant copied to clipboard

has_many relationships are not correctly sorted by id ascending as they should be.

Open ptarud opened this issue 6 months ago • 0 comments

has_many relationships are not correctly sorted by id ascending as they should be, that cause the user should specify in the relationship the order. This is not a common behaviour in RoR, because if for anything we need to sort it by id descending the query that it generates will be SELECT * FROM table_name ORDER BY table_name.id ASC AND table_name.id DESC, and nobody wants to have to do a reorder every time they wants ordering by a different attribute.

I have not tested yet if it happens the same behaviour for "parent" tables.

ptarud avatar Aug 15 '24 19:08 ptarud