mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: show date of last edit on wiki topics
This commit is contained in:
@@ -68,7 +68,8 @@ class PostSerializer < BasicPostSerializer
|
||||
:via_email,
|
||||
:is_auto_generated,
|
||||
:action_code,
|
||||
:action_code_who
|
||||
:action_code_who,
|
||||
:last_wiki_edit
|
||||
|
||||
def initialize(object, opts)
|
||||
super(object, opts)
|
||||
@@ -353,6 +354,14 @@ class PostSerializer < BasicPostSerializer
|
||||
include_action_code? && action_code_who.present?
|
||||
end
|
||||
|
||||
def last_wiki_edit
|
||||
object.revisions.last.updated_at
|
||||
end
|
||||
|
||||
def include_last_wiki_edit?
|
||||
object.wiki && object.post_number == 1
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def post_actions
|
||||
|
||||
Reference in New Issue
Block a user