Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename method to avoid misleading readers #2489

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading