mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
3b9982a3b7
When calling ordered finder methods such as +first+ or +last+ without an explicit order clause, ActiveRecord sorts records by primary key. This can result in unpredictable and surprising behaviour when the primary key is not an auto-incrementing integer, for example when it's a UUID. This change makes it possible to override the column used for implicit ordering such that +first+ and +last+ will return more predictable results. For Example: class Project < ActiveRecord::Base self.implicit_order_column = "created_at" end |
||
---|---|---|
.. | ||
batches | ||
predicate_builder | ||
batches.rb | ||
calculations.rb | ||
delegation.rb | ||
finder_methods.rb | ||
from_clause.rb | ||
merger.rb | ||
predicate_builder.rb | ||
query_attribute.rb | ||
query_methods.rb | ||
record_fetch_warning.rb | ||
spawn_methods.rb | ||
where_clause.rb | ||
where_clause_factory.rb |