Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Raise exception instead of throw call.

Pavel Balashoua97f7410d048
diff --git a/app/models/role.rb b/app/models/role.rb
index 4384396f6cc..d1c328e8eea 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -42,7 +42,7 @@ class Role < ApplicationRecord
before_destroy(prepend: true) do
unless deletable?
errors.add(:base, "can't be destroyed")
- throw :abort
+ raise ActiveRecord::RecordNotDestroyed
end
end