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

Allow message_type public access

Oliver Günther685332ca5820
diff --git a/app/services/service_result.rb b/app/services/service_result.rb
index a61e07f67f9..71d527de867 100644
--- a/app/services/service_result.rb
+++ b/app/services/service_result.rb
@@ -336,6 +336,16 @@ class ServiceResult
ApplicationRecord.human_attribute_name(*)
end
+ def message_type
+ if @message_type
+ @message_type.to_sym
+ elsif success?
+ :notice
+ else
+ :error
+ end
+ end
+
private
def initialize_errors(errors, provided_result)
@@ -349,16 +359,6 @@ class ServiceResult
end
end
- def message_type
- if @message_type
- @message_type.to_sym
- elsif success?
- :notice
- else
- :error
- end
- end
-
def merge_success!(other)
self.success &&= other.success
end