diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c0fb7a5ce21..bef79e451a8 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -86,8 +86,6 @@ Rails/WhereExists: - 'app/models/status.rb' - 'app/policies/status_policy.rb' - 'app/serializers/rest/announcement_serializer.rb' - - 'app/services/activitypub/fetch_remote_status_service.rb' - - 'app/services/vote_service.rb' - 'app/workers/move_worker.rb' - 'spec/models/account_spec.rb' - 'spec/services/activitypub/process_collection_service_spec.rb' diff --git a/app/services/activitypub/fetch_remote_status_service.rb b/app/services/activitypub/fetch_remote_status_service.rb index a491b32b26d..e3a9b60b567 100644 --- a/app/services/activitypub/fetch_remote_status_service.rb +++ b/app/services/activitypub/fetch_remote_status_service.rb @@ -44,7 +44,7 @@ class ActivityPub::FetchRemoteStatusService < BaseService # If we fetched a status that already exists, then we need to treat the # activity as an update rather than create - activity_json['type'] = 'Update' if equals_or_includes_any?(activity_json['type'], %w(Create)) && Status.where(uri: object_uri, account_id: actor.id).exists? + activity_json['type'] = 'Update' if equals_or_includes_any?(activity_json['type'], %w(Create)) && Status.exists?(uri: object_uri, account_id: actor.id) with_redis do |redis| discoveries = redis.incr("status_discovery_per_request:#{@request_id}") diff --git a/app/services/vote_service.rb b/app/services/vote_service.rb index 3e92a1690a6..878350388b8 100644 --- a/app/services/vote_service.rb +++ b/app/services/vote_service.rb @@ -19,7 +19,7 @@ class VoteService < BaseService already_voted = true with_redis_lock("vote:#{@poll.id}:#{@account.id}") do - already_voted = @poll.votes.where(account: @account).exists? + already_voted = @poll.votes.exists?(account: @account) ApplicationRecord.transaction do @choices.each do |choice|