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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user