mirror of
https://github.com/anteo/redmine_custom_workflows.git
synced 2026-01-26 08:14:20 +00:00
Interference with other redmine-plugins #320
This commit is contained in:
parent
f3b478d258
commit
72354c98a3
@ -73,17 +73,16 @@ class CustomWorkflow < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.run_shared_code(object)
|
def self.run_shared_code(object)
|
||||||
if CustomWorkflow.table_exists? # Due to DB migration
|
# Due to DB migration
|
||||||
if CustomWorkflow.active.where(observable: :shared).exists?
|
if CustomWorkflow.table_exists? && CustomWorkflow.active.exists?(observable: :shared)
|
||||||
log_message '= Running shared code', object
|
log_message '= Running shared code', object
|
||||||
CustomWorkflow.active.where(observable: :shared).sorted.each do |workflow|
|
CustomWorkflow.active.where(observable: :shared).sorted.each do |workflow|
|
||||||
unless workflow.run(object, :shared_code)
|
unless workflow.run(object, :shared_code)
|
||||||
log_message '= Abort running shared code', object
|
log_message '= Abort running shared code', object
|
||||||
return false
|
return false
|
||||||
end
|
|
||||||
end
|
end
|
||||||
log_message '= Finished running shared code', object
|
|
||||||
end
|
end
|
||||||
|
log_message '= Finished running shared code', object
|
||||||
end
|
end
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user