Use existing arel scopes instead of string ordering (#32801)
This commit is contained in:
parent
bde0f1239a
commit
10c895dc84
2 changed files with 4 additions and 2 deletions
|
@ -32,7 +32,7 @@ class Admin::StatusFilter
|
|||
def scope_for(key, _value)
|
||||
case key.to_s
|
||||
when 'media'
|
||||
Status.joins(:media_attachments).merge(@account.media_attachments).group(:id).reorder('statuses.id desc')
|
||||
Status.joins(:media_attachments).merge(@account.media_attachments).group(:id).recent
|
||||
else
|
||||
raise Mastodon::InvalidParameterError, "Unknown filter: #{key}"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue