NameError: uninitialized constant #122

This commit is contained in:
Karel Pičman 2019-04-03 14:02:34 +02:00
parent 7c8ee589cb
commit 14ea99ec7d

View File

@ -54,14 +54,15 @@ class CustomWorkflow < ActiveRecord::Base
end
def self.run_shared_code(object)
workflows = CustomWorkflow.active.where(:observable => :shared)
log_message '= Running shared code', object
workflows.each do |workflow|
CustomWorkflow.table_exists? # Due to DB migration
CustomWorkflow.active.where(:observable => :shared).find_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
true
end