Skip to content

Commit

Permalink
IC Builder auto_model_class for automation managers
Browse files Browse the repository at this point in the history
manager module forced to AutomationManager
  • Loading branch information
slemrmartin committed Jul 18, 2018
1 parent 87d1dd2 commit 7358e42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/manager_refresh/inventory_collection/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def auto_model_class
model_class = begin
# a) Provider specific class
provider_module = ManageIQ::Providers::Inflector.provider_module(@persister_class).name
manager_module = self.class.name.split('::').last
manager_module = auto_model_class_manager_module

class_name = "#{provider_module}::#{manager_module}::#{@name.to_s.classify}"
class_name.safe_constantize
Expand All @@ -210,6 +210,10 @@ def auto_model_class
end
end

def auto_model_class_manager_module
self.class.name.split('::').last
end

# Inventory object attributes are derived from setters
#
# Can be disabled by options :auto_inventory_attributes => false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def vms

protected

def auto_model_class_manager_module
'AutomationManager'
end

def default_manager_ref
add_properties(:manager_ref => %i(manager_ref))
end
Expand Down

0 comments on commit 7358e42

Please sign in to comment.