Add conditions_fulfilled? method

This commit is contained in:
aignatov-bio 2020-09-03 14:19:28 +02:00
parent 4c1e120f23
commit 8b1e11a314

View file

@ -47,6 +47,14 @@ class MyModuleStatus < ApplicationRecord
ordered_statuses
end
def conditions_fulfilled?(my_module)
my_module_status_conditions.each do |condition|
condition.call(my_module)
end
my_module.errors.blank?
end
private
def next_in_same_flow