diff --git a/app/models/conversion_host.rb b/app/models/conversion_host.rb index 1b2c9d07320..e5d50e715f9 100644 --- a/app/models/conversion_host.rb +++ b/app/models/conversion_host.rb @@ -5,7 +5,7 @@ class ConversionHost < ApplicationRecord belongs_to :resource, :polymorphic => true has_many :service_template_transformation_plan_tasks, :dependent => :nullify - has_many :active_tasks, -> { where(:state => 'active') }, :class_name => ServiceTemplateTransformationPlanTask, :inverse_of => :conversion_host + has_many :active_tasks, -> { where(:state => ['active', 'migrate']) }, :class_name => ServiceTemplateTransformationPlanTask, :inverse_of => :conversion_host delegate :ext_management_system, :hostname, :ems_ref, :to => :resource, :allow_nil => true validates :name, :presence => true diff --git a/spec/models/conversion_host_spec.rb b/spec/models/conversion_host_spec.rb index fab5359bd10..37812a23f49 100644 --- a/spec/models/conversion_host_spec.rb +++ b/spec/models/conversion_host_spec.rb @@ -11,7 +11,7 @@ let(:conversion_host_2) { FactoryBot.create(:conversion_host, :resource => vm) } let(:task_1) { FactoryBot.create(:service_template_transformation_plan_task, :state => 'active', :conversion_host => conversion_host_1) } let(:task_2) { FactoryBot.create(:service_template_transformation_plan_task, :conversion_host => conversion_host_1) } - let(:task_3) { FactoryBot.create(:service_template_transformation_plan_task, :state => 'active', :conversion_host => conversion_host_2) } + let(:task_3) { FactoryBot.create(:service_template_transformation_plan_task, :state => 'migrate', :conversion_host => conversion_host_2) } before do allow(conversion_host_1).to receive(:active_tasks).and_return([task_1])