From 434770f580016acff6bdb51dc6715bffefb44150 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 20 Feb 2023 20:21:48 -0500 Subject: Autofix Rubocop Rails/FindById (#23762) --- app/controllers/api/v1/notifications_controller.rb | 2 +- app/controllers/media_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb index 2024d521c..8414f6b25 100644 --- a/app/controllers/api/v1/notifications_controller.rb +++ b/app/controllers/api/v1/notifications_controller.rb @@ -24,7 +24,7 @@ class Api::V1::NotificationsController < Api::BaseController end def dismiss - current_account.notifications.find_by!(id: params[:id]).destroy! + current_account.notifications.find(params[:id]).destroy! render_empty end diff --git a/app/controllers/media_controller.rb b/app/controllers/media_controller.rb index 3cdd97f06..133564ee7 100644 --- a/app/controllers/media_controller.rb +++ b/app/controllers/media_controller.rb @@ -32,7 +32,7 @@ class MediaController < ApplicationController scope = MediaAttachment.local.attached # If id is 19 characters long, it's a shortcode, otherwise it's an identifier - @media_attachment = id.size == 19 ? scope.find_by!(shortcode: id) : scope.find_by!(id: id) + @media_attachment = id.size == 19 ? scope.find_by!(shortcode: id) : scope.find(id) end def verify_permitted_status! -- cgit