24
25
26
27
28
29
30
31
32
33
|
# File 'lib/microsoft_graph/base_entity.rb', line 24
def containing_navigation_property(type_name)
candidate_navigation_properties = navigation_properties.values.select do |navigation_property|
navigation_property.collection? && navigation_property.type.name == "Collection(#{type_name})"
end
candidate_navigation_properties.sort { |a, b|
a_index = type_name.downcase.index(a.name[0..-2].downcase) || 0
b_index = type_name.downcase.index(b.name[0..-2].downcase) || 0
a_index <=> b_index
}.last
end
|