versions: remove 'subsequent' version comparison option.

This option was rarely used and what it actually did was usually
difficult to understand.
This commit is contained in:
evazion
2022-09-18 05:32:02 -05:00
parent 1d2bac7b95
commit 0c919a6bc8
9 changed files with 2 additions and 36 deletions

View File

@@ -65,7 +65,7 @@ class ApplicationController < ActionController::Base
end
def set_version_comparison(default_type = "previous")
params[:type] = %w[previous subsequent current].include?(params[:type]) ? params[:type] : default_type
params[:type] = %w[previous current].include?(params[:type]) ? params[:type] : default_type
end
def model_name

View File

@@ -62,7 +62,7 @@ module ApplicationHelper
def version_type_links(params)
html = []
%w[previous subsequent current].each do |type|
%w[previous current].each do |type|
if type == params[:type]
html << %{<span>#{type}</span>}
else

View File

@@ -6,8 +6,6 @@ module ArtistVersionsHelper
this_names = artist_version.other_names
if other.present?
other_names = other.other_names
elsif type == "subsequent"
other_names = this_names
else
other_names = []
end
@@ -24,8 +22,6 @@ module ArtistVersionsHelper
this_urls = artist_version.urls
if other.present?
other_urls = other.urls
elsif type == "subsequent"
other_urls = this_urls
else
other_urls = []
end

View File

@@ -30,11 +30,6 @@ class ArtistCommentaryVersion < ApplicationRecord
@previous.first
end
def subsequent
@subsequent ||= ArtistCommentaryVersion.where("post_id = ? and updated_at > ?", post_id, updated_at).order("updated_at asc").limit(1).to_a
@subsequent.first
end
def current
@current ||= ArtistCommentaryVersion.where(post_id: post_id).order("updated_at desc").limit(1).to_a
@current.first

View File

@@ -40,11 +40,6 @@ class ArtistVersion < ApplicationRecord
@previous.first
end
def subsequent
@subsequent ||= ArtistVersion.where("artist_id = ? and created_at > ?", artist_id, created_at).order("created_at asc").limit(1).to_a
@subsequent.first
end
def current
@previous ||= ArtistVersion.where(artist_id: artist_id).order("created_at desc").limit(1).to_a
@previous.first

View File

@@ -19,11 +19,6 @@ class NoteVersion < ApplicationRecord
@previous.first
end
def subsequent
@subsequent ||= NoteVersion.where("note_id = ? and version > ?", note_id, version).order("updated_at asc").limit(1).to_a
@subsequent.first
end
def current
@current ||= NoteVersion.where(note_id: note_id).order("updated_at desc").limit(1).to_a
@current.first

View File

@@ -100,11 +100,6 @@ class PoolVersion < ApplicationRecord
@previous.first
end
def subsequent
@subsequent ||= PoolVersion.where("pool_id = ? and version > ?", pool_id, version).order("version asc").limit(1).to_a
@subsequent.first
end
def current
@current ||= PoolVersion.where(pool_id: pool_id).order("version desc").limit(1).to_a
@current.first

View File

@@ -128,11 +128,6 @@ class PostVersion < ApplicationRecord
@previous.first
end
def subsequent
@subsequent ||= PostVersion.where("post_id = ? and version > ?", post_id, version).order("version asc").limit(1).to_a
@subsequent.first
end
def current
@current ||= PostVersion.where(post_id: post_id).order("version desc").limit(1).to_a
@current.first

View File

@@ -29,11 +29,6 @@ class WikiPageVersion < ApplicationRecord
@previous.first
end
def subsequent
@subsequent ||= WikiPageVersion.where("wiki_page_id = ? and id > ?", wiki_page_id, id).order("id asc").limit(1).to_a
@subsequent.first
end
def current
@current ||= WikiPageVersion.where(wiki_page_id: wiki_page_id).order("id desc").limit(1).to_a
@current.first