If I have the following nested model relationships (all has_many): Countries < Cities < Streets < Homes
In a show view, how can I check if a particular Country has any homes?
Edit: Adding the suggested method of chaining with the map method (first try to map to streets). So far it's not restricting the records
<% @countries.each do |country| %>
<% if country.cities.map(&:streets).any? %>
....
<% end %>
<% end %>
country.cities.map(&:streets).flatten.any?