Skip to content

Conversation

davearonson
Copy link
Contributor

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:

  • [Yes] This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • [Yes] Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • [N/A] Tests are added or updated if you fix a bug or add a feature.
  • [N/A] CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

In Getting Started guide, in the article and comment status dropdowns, use Visible::VALID_STATUSES instead of repeating the list of valid statuses.  This makes the code DRYer and more expressive.  This PR also adds a comment to that effect.
@rails-bot rails-bot bot added the docs label Aug 23, 2023
@rafaelfranca
Copy link
Member

Can you resolve the conflicts in this file now please?

Copy link
Member

@akhilgkrishnan akhilgkrishnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davearonson
Copy link
Contributor Author

@davearonson Can you do a squash commit

@akhilgkrishnan I'm trying to figure out how to do that on Github online, without downloading such a large repo, and am getting lost. Any hints? Alternately, it seem Github allows a merger to squash it when merging. Would that do?

@rafaelfranca rafaelfranca merged commit f6b987d into rails:main Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants