AR: Do not spawn additional queries when rendering page_entries_info.

`collection.first.class` will spawn a LIMIT 1 query, while `collection.empty?`
will spawn a COUNT query. The latter is not a problem since a COUNT query is
needed anyway, so redundant ones will retrieve from cache. The former, however,
can add unnecessary load to the database.

As far as I can tell, ActiveRecord::Relation has a `klass` attribute since the
beginning, so it should be fine. The attribute is also aliased as `model` since
https://github.com/rails/rails/pull/6606, though this change is only available
in Rails 4.x.