Merged
requested to merge github/fork/patrickgramatowski/enable-sort-by-association-attribute into main
Created by: patrickgramatowski
Enable ordering the BelongsTo fields by using order option. The change let the gem users to be able to order the fields by the column they'll specify, instead of ordering by id
.
I've also updated the query to solve the possible issues with PG::AmbiguousColumn
errors - for now it's not handled in any way, so if the user is using the tables that use the same columns names, then the error will apear and the only way to fix that is to monkey patch the gem. To solve that, I've added the column name as the prefix for both possible forms of the query.
Based on #1215 And kinda related to #1805 the result is exactly as presented on videos attached to this task's description.