Skip to content

Commit

Permalink
Fix invalid conversion host resource type
Browse files Browse the repository at this point in the history
Fix an invalid polymorphic resource_type from
ManageIQ#281 which resulted in
the type being "AddConversionHostIdToMiqRequestTasks::Host" instead of
"Host".
  • Loading branch information
agrare committed Oct 2, 2018
1 parent eb7e077 commit 6f8abf5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions db/migrate/20181002192054_fix_conversion_host_resource_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class FixConversionHostResourceType < ActiveRecord::Migration[5.0]
class ConversionHost < ActiveRecord::Base
self.inheritance_column = :_type_disabled
include ActiveRecord::IdRegions
end

def up
say_with_time("Converting invalid resource_type to Host") do
ConversionHost.in_my_region
.where(:resource_type => "AddConversionHostIdToMiqRequestTasks::Host")
.update_all(:resource_type => "Host")
end
end
end

0 comments on commit 6f8abf5

Please sign in to comment.