about summary refs log tree commit diff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-03-26 18:36:16 +0100
committerGitHub <noreply@github.com>2021-03-26 18:36:16 +0100
commita650a1157d5b71bc5718759643fe5bb572b16a8b (patch)
treeecf2c5696521b912c578b90543cedd0e202db4d3 /app/controllers/admin
parent59f94593d059239c28ab5fb8e2a0c23ce2590254 (diff)
Fix /admin/tags/:id crashing since Rails 6.1 update (#15953)
Raw SQL passed to `pluck` now has to be explicitly marked as SQL via
Arel.sql, see https://github.com/rails/rails/pull/27947
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/tags_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb
index 59df4470e..eed4feea2 100644
--- a/app/controllers/admin/tags_controller.rb
+++ b/app/controllers/admin/tags_controller.rb
@@ -59,8 +59,8 @@ module Admin
                              .where(Status.arel_table[:id].gteq(Mastodon::Snowflake.id_at(Time.now.utc.beginning_of_day)))
                              .joins(:account)
                              .group('accounts.domain')
-                             .reorder('statuses_count desc')
-                             .pluck('accounts.domain, count(*) AS statuses_count')
+                             .reorder(statuses_count: :desc)
+                             .pluck(Arel.sql('accounts.domain, count(*) AS statuses_count'))
     end
 
     def set_counters