Skip to content

Commit

Permalink
Fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiendupont committed Oct 1, 2018
1 parent 47072a7 commit 3713049
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class AddConversionHostIdToMiqRequestTasks < ActiveRecord::Migration[5.0]

class MiqRequestTask < ActiveRecord::Base
self.inheritance_column = :_type_disabled
serialize :options, Hash
Expand All @@ -22,7 +21,7 @@ class Host < ActiveRecord::Base
def up
add_column :miq_request_tasks, :conversion_host_id, :bigint

ServiceTemplateTransformationPlanTask.all.select { |task| not task.options[:transformation_host_id].nil? }.each do |task|
ServiceTemplateTransformationPlanTask.all.reject { |task| task.options[:transformation_host_id].nil? }.each do |task|
host = Host.find_by(:id => task.options[:transformation_host_id])
task.conversion_host = ConversionHost.where(:id => task.options[:transformation_host_id]).first_or_create do |ch|
ch.name = host.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe AddConversionHostIdToMiqRequestTasks do
let(:task_stub) { migration_stub(:MiqRequestTask) }
let(:host_stub) { migration_stub(:Host) }
let(:conversion_host_stub) { migration_stub(:ConversionHost) }
let(:conversion_host_stub) { migration_stub(:ConversionHost) }

migration_context :up do
it "creates conversion host" do
Expand Down Expand Up @@ -33,7 +33,6 @@
:resource_type => host.type
)
conversion_host.save
conversion_host_id = conversion_host.id
task.conversion_host = conversion_host
task.save

Expand Down

0 comments on commit 3713049

Please sign in to comment.