Replace repeated list literals in Getting Started guide w/ a constant #49007
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
In Getting Started guide, in the article and comment status dropdowns, it repeats the literal list of valid statuses estabished in the Visible module. In fact, it does so twice! It would make the code DRYer, briefer, and more expressive, to use Visible::VALID_STATUSES instead. This PR does so, and also adds a sentence explaining why, in the preceding text.
This Pull Request has been created because it just bugged me to see it so horribly un-DRY, in something that (were it anything approaching a "real" app), would be very subject to change, such as by adding a "deleted" status. This tiny change will help get/reinforce the idea of DRY in Rails-beginners' minds, without clubbing them over the head with it, nor (IMHO) taking it too far. (After all, the constant was already there, convenient to use.)
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]