For my fellow Ruby newbies, section_ids * ‘,’ expands to a string with each element of the section_ids array and a ‘,’ in between: “1,2,3”
#{} allows substituting the value of any Ruby code into a string. The net effect is a condition such as ‘section_id in (1,2,3)’
This won’t work in this case because I need the entries sorted by time_stamp across all sections, so I’d have to iterate through the returned sections, store all the entries and then sort them myself. Doing an Entry.find along with :order makes the database do the sorting for me.