Merge pull request #5023 from 9suika/fix/favgroup-updated-at
favorite_groups: make search[order]=updated_at work
This commit is contained in:
@@ -43,6 +43,8 @@ class FavoriteGroup < ApplicationRecord
|
||||
q = q.order(name: :asc, id: :desc)
|
||||
when "created_at"
|
||||
q = q.order(id: :desc)
|
||||
when "updated_at"
|
||||
q = q.order(updated_at: :desc)
|
||||
when "post_count"
|
||||
q = q.order(Arel.sql("cardinality(post_ids) desc")).order(id: :desc)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user