Ask about 'Draft' before asking about 'Post'

`Draft`s are a subclass of `Post` so `draft.is_a?(Post)` will return
`true`, thus making all `Draft`s `Post`s, which is not desired. If
asking about `Draft` first, then we avoid this problem.

Fixes #2726
This commit is contained in:
Parker Moore 2014-08-12 11:52:16 -04:00
parent 60c29561f2
commit 9c090c862f
1 changed files with 3 additions and 3 deletions

View File

@ -128,12 +128,12 @@ module Jekyll
#
# Returns the type of self.
def type
if is_a?(Post)
if is_a?(Draft)
:drafts
elsif is_a?(Post)
:posts
elsif is_a?(Page)
:pages
elsif is_a?(Draft)
:drafts
end
end