Remove redundant check deleting content blocks

The `find` method raises an exception if nothing is found, so there's no
need to check if it found something.
This commit is contained in:
Javi Martín
2019-10-10 02:54:20 +02:00
parent aace7aea02
commit 6ceca143b4

View File

@@ -67,8 +67,7 @@ class Admin::SiteCustomization::ContentBlocksController < Admin::SiteCustomizati
end
def delete_heading_content_block
heading_content_block = Budget::ContentBlock.find(params[:id])
heading_content_block.destroy if heading_content_block
Budget::ContentBlock.find(params[:id]).destroy
notice = t("admin.site_customization.content_blocks.destroy.notice")
redirect_to admin_site_customization_content_blocks_path, notice: notice
end