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

@@ -4,7 +4,7 @@ class PoolVersionsController < ApplicationController
around_action :set_timeout
def index
@pool_versions = PoolArchive.paginated_search(params)
@pool_versions = PoolVersion.paginated_search(params)
@pool_versions = @pool_versions.includes(:updater, :pool) if request.format.html?
respond_with(@pool_versions)
@@ -14,10 +14,10 @@ class PoolVersionsController < ApplicationController
end
def diff
@pool_version = PoolArchive.find(params[:id])
@pool_version = PoolVersion.find(params[:id])
if params[:other_id]
@other_version = PoolArchive.find(params[:other_id])
@other_version = PoolVersion.find(params[:other_id])
else
@other_version = @pool_version.previous
end
@@ -25,19 +25,15 @@ class PoolVersionsController < ApplicationController
private
def model_name
"PoolArchive"
end
def set_timeout
PoolArchive.connection.execute("SET statement_timeout = #{CurrentUser.user.statement_timeout}")
PoolVersion.connection.execute("SET statement_timeout = #{CurrentUser.user.statement_timeout}")
yield
ensure
PoolArchive.connection.execute("SET statement_timeout = 0")
PoolVersion.connection.execute("SET statement_timeout = 0")
end
def check_availabililty
if !PoolArchive.enabled?
if !PoolVersion.enabled?
raise NotImplementedError.new("Archive service is not configured. Pool versions are not saved.")
end
end