FIX: non-logged in users couldn't see who liked something
This commit is contained in:
parent
8942d9a094
commit
4ad006ea97
|
@ -72,7 +72,7 @@ class PostActionsController < ApplicationController
|
||||||
finder = Post.where(id: params[:id])
|
finder = Post.where(id: params[:id])
|
||||||
|
|
||||||
# Include deleted posts if the user is a moderator (to guardian ?)
|
# Include deleted posts if the user is a moderator (to guardian ?)
|
||||||
finder = finder.with_deleted if current_user.moderator?
|
finder = finder.with_deleted if current_user.try(:moderator?)
|
||||||
|
|
||||||
@post = finder.first
|
@post = finder.first
|
||||||
guardian.ensure_can_see!(@post)
|
guardian.ensure_can_see!(@post)
|
||||||
|
|
Loading…
Reference in New Issue