implement postarchive

This commit is contained in:
Albert Yi
2017-01-13 17:21:05 -08:00
committed by r888888888
parent 6c9d5e4f9a
commit 5404c1d231
17 changed files with 378 additions and 98 deletions

View File

@@ -3,7 +3,7 @@ class PostVersionsController < ApplicationController
rescue_from ActiveRecord::StatementInvalid, :with => :rescue_exception
def index
@post_versions = PostVersion.search(params[:search]).order("updated_at desc, id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
@post_versions = PostArchive.search(params[:search]).order("updated_at desc, id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@post_versions) do |format|
format.xml do
render :xml => @post_versions.to_xml(:root => "post-versions")
@@ -15,7 +15,7 @@ class PostVersionsController < ApplicationController
end
def undo
@post_version = PostVersion.find(params[:id])
@post_version = PostArchive.find(params[:id])
if @post_version.post.visible?
@post_version.undo!