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

@@ -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