FIX: don't include last_wiki_edit when there's no revision

This commit is contained in:
Régis Hanol 2017-09-13 17:46:58 +02:00
parent 0096ee40da
commit a6fc42753c
1 changed files with 3 additions and 1 deletions

View File

@ -359,7 +359,9 @@ class PostSerializer < BasicPostSerializer
end
def include_last_wiki_edit?
object.wiki && object.post_number == 1
object.wiki &&
object.post_number == 1 &&
object.revisions.size > 0
end
private