models: rename post/pool archives to post/pool versions.

This commit is contained in:
evazion
2020-02-15 06:52:10 -06:00
parent 51f3f7338a
commit 60ff2ae929
27 changed files with 71 additions and 84 deletions

View File

@@ -6,7 +6,7 @@ class PostVersionsController < ApplicationController
respond_to :js, only: [:undo]
def index
@post_versions = PostArchive.paginated_search(params)
@post_versions = PostVersion.paginated_search(params)
if request.format.html?
@post_versions = @post_versions.includes(:updater, post: [:uploader, :versions])
@@ -21,7 +21,7 @@ class PostVersionsController < ApplicationController
end
def undo
@post_version = PostArchive.find(params[:id])
@post_version = PostVersion.find(params[:id])
@post_version.undo!
respond_with(@post_version)
@@ -29,19 +29,15 @@ class PostVersionsController < ApplicationController
private
def model_name
"PostArchive"
end
def set_timeout
PostArchive.connection.execute("SET statement_timeout = #{CurrentUser.user.statement_timeout}")
PostVersion.connection.execute("SET statement_timeout = #{CurrentUser.user.statement_timeout}")
yield
ensure
PostArchive.connection.execute("SET statement_timeout = 0")
PostVersion.connection.execute("SET statement_timeout = 0")
end
def check_availabililty
if !PostArchive.enabled?
if !PostVersion.enabled?
raise NotImplementedError.new("Archive service is not configured. Post versions are not saved.")
end
end