Use hash arguments to order when possible (Rails 7.2) (#32915)

This commit is contained in:
Matt Jankowski 2024-11-18 10:07:53 -05:00 committed by GitHub
commit da826fe959
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View file

@ -48,7 +48,7 @@ module Account::Associations
end
# Status records pinned by the account
has_many :pinned_statuses, -> { reorder('status_pins.created_at DESC') }, through: :status_pins, class_name: 'Status', source: :status
has_many :pinned_statuses, -> { reorder(status_pins: { created_at: :desc }) }, through: :status_pins, class_name: 'Status', source: :status
# Account records endorsed (pinned) by the account
has_many :endorsed_accounts, through: :account_pins, class_name: 'Account', source: :target_account