Interference with other redmine-plugins #320

This commit is contained in:
Karel Pičman 2023-09-06 08:15:46 +02:00
parent b0a242c2dc
commit f3b478d258

View File

@ -73,16 +73,18 @@ class CustomWorkflow < ApplicationRecord
end
def self.run_shared_code(object)
log_message '= Running shared code', object
if CustomWorkflow.table_exists? # Due to DB migration
if CustomWorkflow.active.where(observable: :shared).exists?
log_message '= Running shared code', object
CustomWorkflow.active.where(observable: :shared).sorted.each do |workflow|
unless workflow.run(object, :shared_code)
log_message '= Abort running shared code', object
return false
end
end
end
log_message '= Finished running shared code', object
end
end
true
end