add diff link on wiki page versions (#1622)
This commit is contained in:
@@ -4,6 +4,8 @@ class WikiPageVersion < ApplicationRecord
|
||||
belongs_to :artist, optional: true
|
||||
delegate :visible?, :to => :wiki_page
|
||||
|
||||
extend Memoist
|
||||
|
||||
module SearchMethods
|
||||
def for_user(user_id)
|
||||
where("updater_id = ?", user_id)
|
||||
@@ -35,6 +37,11 @@ class WikiPageVersion < ApplicationRecord
|
||||
title.tr("_", " ")
|
||||
end
|
||||
|
||||
def previous
|
||||
WikiPageVersion.where("wiki_page_id = ? and id < ?", wiki_page_id, id).order("id desc").first
|
||||
end
|
||||
memoize :previous
|
||||
|
||||
def category_name
|
||||
Tag.category_for(title)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user