FEATURE: ability to hide or show specific post revisions

This commit is contained in:
David McClure
2014-10-13 01:18:49 -07:00
parent 1f8e1f8f17
commit 19d5362c6b
11 changed files with 195 additions and 39 deletions

View File

@ -216,6 +216,20 @@ class PostsController < ApplicationController
render_json_dump(post_revision_serializer)
end
def hide_revision
post_revision = find_post_revision_from_params
guardian.ensure_can_hide_post_revision! post_revision
post_revision.hide!
render nothing: true
end
def show_revision
post_revision = find_post_revision_from_params
guardian.ensure_can_show_post_revision! post_revision
post_revision.show!
render nothing: true
end
def bookmark
post = find_post_from_params
if current_user