Skip to content

Chapter 17.3 - inaccurate description of code listing #2745

@helixbass

Description

@helixbass

The description "if the state is Published, we want to return the value in the post’s content field; otherwise, we want to return an empty string slice, as shown in Listing 17-17:" in chapter 17.3 seems "prematurely specific" for the content of Listing 17.17, which only shows that the Post content method is now delegating to a new content method on State (nothing yet about an empty string slice):
Screen Shot 2021-05-31 at 2 55 19 PM

Also (separate issue but nearby in the text), this is arguably a little inaccurate because it sounds like it implies that calling request_review on a Draft returns self, which isn't true (it returns a PendingReview): "Similar to request_review, if we call the approve method on a Draft, it will have no effect because it will return self". I guess the "similarity" would be that calling request_review on a PendingReview returns self, but it doesn't really read that way

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions