def restore
      post = Post.find(params[:id])
      # do the restore
      restore = Post.restore(post)

      url = 
        if restore.post_type == 'page'
          "/admin/pages/#{restore.id}/edit"
        elsif restore.post_type == 'post'
          "/admin/articles/#{restore.id}/edit"
        end

      # redirect to either the post or page area depending on what post_type the post has
      redirect_to URI.parse(url).path, notice: I18n.t("controllers.admin.revisions.restore.flash.notice", post_type: restore.post_type.capitalize)
    end
def restore
      post = Post.find(params[:id])
      # do the restore
      restore = Post.restore(post)

      url = 
        if restore.post_type == 'page'
          "/admin/pages/#{restore.id}/edit"
        elsif restore.post_type == 'post'
          "/admin/articles/#{restore.id}/edit"
        end

      # redirect to either the post or page area depending on what post_type the post has
      redirect_to URI.parse(url).path, notice: I18n.t("controllers.admin.revisions.restore.flash.notice", post_type: restore.post_type.capitalize)
    end
restore the post to the given post data