Skip to content

Commit

Permalink
Do not fail if the method is not defined on the topology graph
Browse files Browse the repository at this point in the history
Conflict resolver PR for ManageIQ#1221
  • Loading branch information
skateman committed May 2, 2017
1 parent 98321a2 commit 0907710
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/services/topology_service.rb
Expand Up @@ -54,7 +54,9 @@ def build_recursive_topology(entity, entity_relationships_mapping, topo_items, l
topo_items[entity_id(entity)] = build_entity_data(entity)
unless entity_relationships_mapping.nil?
entity_relationships_mapping.keys.each do |rel_name|
relations = entity.send(rel_name.to_s.underscore.downcase)
method = rel_name.to_s.underscore.downcase
next unless entity.respond_to?(method)
relations = entity.send(method)
if relations.kind_of?(ActiveRecord::Associations::CollectionProxy)
relations.each do |relation|
build_rel_data_and_links(entity, entity_relationships_mapping, rel_name, links, relation, topo_items)
Expand Down

0 comments on commit 0907710

Please sign in to comment.