Listing cities in an itinerary
You can use includes on any activerecord relation.

Judging by your message about having N+1 queries I suspect you are calling city_names somewhere in a loop. then the correct placement of the includes is the place where you select the elements to loop past.

I'm guessing it is for a view or something so i write some example code for .html.erb.

In controller:

@travels = Travels.all.includes(destinations: :cities)


In view:

&lt;% @travels.each do |travel| %&gt;
  ... Some code displaying travel info
  &lt;%= travel.city_names %&gt;
  ... More code displaying travel info
&lt;% end %&gt;


And a suggestion in line with what Mark Thomas wrote as a comment. You can refactor you city_names method for more readable code, either according to his suggestion or like this:

def city_names
  self.cities.map(&amp;:name).join(', ')
end