If you need to handle MAX_ROWS being any number up to and including Float::Infinity, you can do the check explicitly with take_while plus with_index:
results_to_display = results.take_while.with_index {|result, index| index < MAX_ROWS }