From 4ec7d7d98911f5047e9da9004748ea5900f975d7 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 19 Jan 2024 04:35:58 -0500 Subject: [PATCH] Fix `Rails/WhereExists` cop in REST::TagSerializer model (#28790) --- .rubocop_todo.yml | 1 - app/serializers/rest/tag_serializer.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 31cefa032..0cebf37b5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -86,7 +86,6 @@ Rails/WhereExists: - 'app/models/status.rb' - 'app/policies/status_policy.rb' - 'app/serializers/rest/announcement_serializer.rb' - - 'app/serializers/rest/tag_serializer.rb' - 'app/services/activitypub/fetch_remote_status_service.rb' - 'app/services/vote_service.rb' - 'app/validators/reaction_validator.rb' diff --git a/app/serializers/rest/tag_serializer.rb b/app/serializers/rest/tag_serializer.rb index 7801e77d1..017b57271 100644 --- a/app/serializers/rest/tag_serializer.rb +++ b/app/serializers/rest/tag_serializer.rb @@ -19,7 +19,7 @@ class REST::TagSerializer < ActiveModel::Serializer if instance_options && instance_options[:relationships] instance_options[:relationships].following_map[object.id] || false else - TagFollow.where(tag_id: object.id, account_id: current_user.account_id).exists? + TagFollow.exists?(tag_id: object.id, account_id: current_user.account_id) end end