- @entries = @entries.visible unless can? :unhide, DiaryEntry
- @entries = @entries.order("created_at DESC")
- @entries = @entries.offset((@page - 1) * @page_size)
- @entries = @entries.limit(@page_size)
- @entries = @entries.includes(:user, :language)
+ @entries, @newer_entries_id, @older_entries_id = get_page_items(entries, :includes => [:user, :language])