show locked/unlocked changes on wiki page histories
This commit is contained in:
@@ -37,6 +37,8 @@ class WikiPageVersion < ApplicationRecord
|
||||
title: "Renamed",
|
||||
was_deleted: "Deleted",
|
||||
was_undeleted: "Undeleted",
|
||||
was_locked: "Locked",
|
||||
was_unlocked: "Unlocked",
|
||||
}
|
||||
end
|
||||
|
||||
@@ -63,6 +65,24 @@ class WikiPageVersion < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def was_locked(type)
|
||||
other = send(type)
|
||||
if type == "previous"
|
||||
is_locked && !other.is_locked
|
||||
else
|
||||
!is_locked && other.is_locked
|
||||
end
|
||||
end
|
||||
|
||||
def was_unlocked(type)
|
||||
other = send(type)
|
||||
if type == "previous"
|
||||
!is_locked && other.is_locked
|
||||
else
|
||||
is_locked && !other.is_locked
|
||||
end
|
||||
end
|
||||
|
||||
def self.available_includes
|
||||
[:updater, :wiki_page, :tag]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user