Show deleted diary entries to administrators, if the user isn't also deleted
This will allow administrators to review diary entry deletions from non-spam users.
This commit is contained in:
parent
f2f3fbb1f1
commit
49fc17c6b6
3 changed files with 30 additions and 2 deletions
|
@ -157,7 +157,7 @@ class DiaryEntriesController < ApplicationController
|
|||
@page = (params[:page] || 1).to_i
|
||||
@page_size = 20
|
||||
|
||||
@entries = @entries.visible
|
||||
@entries = @entries.visible unless current_user&.administrator?
|
||||
@entries = @entries.order("created_at DESC")
|
||||
@entries = @entries.offset((@page - 1) * @page_size)
|
||||
@entries = @entries.limit(@page_size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue