Allow post disapprovals to be edited
This commit is contained in:
@@ -17,4 +17,17 @@ class PostDisapprovalsController < ApplicationController
|
||||
|
||||
respond_with(@post_disapprovals)
|
||||
end
|
||||
|
||||
def edit
|
||||
@post_disapproval = authorize PostDisapproval.find(params[:id])
|
||||
respond_with(@post_disapproval)
|
||||
end
|
||||
|
||||
def update
|
||||
@post_disapproval = authorize PostDisapproval.find(params[:id])
|
||||
@post_disapproval.update(permitted_attributes(@post_disapproval))
|
||||
respond_with(@post_disapproval) do |fmt|
|
||||
fmt.html { redirect_to post_path(@post_disapproval.post) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -38,6 +38,10 @@ class PostsController < ApplicationController
|
||||
@child_posts = @post.children
|
||||
@child_posts = @child_posts.undeleted unless include_deleted
|
||||
@sibling_posts = @sibling_posts.includes(:media_asset)
|
||||
|
||||
if CurrentUser.user.is_approver?
|
||||
@previous_disapproval = @post.disapprovals.select { |disapproval| disapproval.user_id == CurrentUser.user.id }.first
|
||||
end
|
||||
end
|
||||
|
||||
respond_with(@post) do |format|
|
||||
|
||||
Reference in New Issue
Block a user