Skip to content

Commit

Permalink
Merge pull request #2489 from alphagov/rename-method-to-avoid-confusion
Browse files Browse the repository at this point in the history
Rename method to avoid misleading readers
  • Loading branch information
mtaylorgds authored Jan 8, 2025
2 parents 822b12e + 661dffe commit 2907d40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/editions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class EditionsController < InheritedResources::Base
require_editor_permissions
end
before_action only: %i[confirm_destroy destroy] do
destroyable_edition?
require_destroyable
end

before_action only: %i[edit_assignee update_assignee] do
Expand Down Expand Up @@ -217,7 +217,7 @@ def permitted_update_params
params.require(:edition).permit(%i[title overview in_beta body major_change change_note])
end

def destroyable_edition?
def require_destroyable
return if @resource.can_destroy?

flash[:danger] = "Cannot delete a #{description(@resource).downcase} that has ever been published."
Expand Down

0 comments on commit 2907d40

Please sign in to comment.