Merge pull request #5276 from nottalulah/wiki-locks

show locked/unlocked changes on wiki page histories
This commit is contained in:
evazion
2022-10-04 18:27:00 -05:00
committed by GitHub

View File

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