Fix failing tests [SCI-4829]

This commit is contained in:
Oleksii Kriuchykhin 2020-08-21 11:58:12 +02:00
parent 02a4da1a55
commit e6e47f5106
2 changed files with 7 additions and 4 deletions

View file

@ -527,7 +527,7 @@ class MyModule < ApplicationRecord
end
def assign_default_status_flow
return unless my_module_status.blank? || MyModuleStatusFlow.global.any?
return if my_module_status.present? || MyModuleStatusFlow.global.blank?
self.my_module_status = MyModuleStatusFlow.global.first.initial_status
end

View file

@ -661,9 +661,12 @@ class TeamImporter
# Find matching status from default flow
default_flow = MyModuleStatusFlow.global.first
status = default_flow.my_module_statuses.find_by(name: my_module_json['my_module']['my_module_status_name'])
status ||= default_flow.initial_status
my_module.my_module_status = status
if default_flow.present?
status = default_flow.my_module_statuses.find_by(name: my_module_json['my_module']['my_module_status_name'])
status ||= default_flow.initial_status
my_module.my_module_status = status
end
my_module.save!
@my_module_mappings[orig_my_module_id] = my_module.id