Use hash arguments to order when possible (Rails 7.2) (#32915)
This commit is contained in:
parent
477412d62a
commit
da826fe959
4 changed files with 11 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue