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
It is my understanding that the most prominent use case of implicit_order_column is to accommodate the use of UUID as the primary key, in which case it seems natural to me to expect the .all query to support the same logic as .first and .last.
The name of the column records are ordered by if no explicit order clause is used during an ordered finder call.
all is not an ordered finder call. Note that all executes SELECT * FROM table, with no order clause; first and last order by primary key by default, which is problematic when using UUIDs.
How to to reproduce:
In the file
app/models/application_record.rb
, add aimplicit_order_column
as follows:A query like...
...will fail to return the records in the
created_at
order.System configuration
Rails version: Rails 7.0.2.2
Ruby version: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
The text was updated successfully, but these errors were encountered: