Skip to content

Conversation

@hachi8833
Copy link
Contributor

Motivation / Background

This Pull Request has been created because wishlists.md contains some errors and typos that disturbs running tests.

Detail

This Pull Request contains the following:

  • Removing has_many :subscribers, dependent: :destroy from Product model because it includes Notifications concern that already declares the has_many: subscribers association. Current declaration is redundant and inconsistent with the final Product model in getting_started.md.
  • Fixing incorrect filename app/models/wishlist.rb to app/models/wishlist_product.rb.
  • Fixing incorrect path store_products_path to store_wishlists_path.
  • Fixing incorrect call pluralize "Subscriber", @subscribers.count to pluralize @subscribers.count, "Subscriber".
  • Fixing incorrect assertion "T-Shirt is already on Second Wishlist." to "T-Shirt is already on Second.".

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • 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]
[ci-skip][doc] Fix filename in wishlist.md [ci-skip][doc] Fix link paths in wishlists.md [ci-skip][doc] Fix pluralize method in wishlists.md [ci-skip][doc] Fix assertion in wishlists.md
@github-actions github-actions bot added the docs label Oct 24, 2025
class Product < ApplicationRecord
include Notifications
has_many :subscribers, dependent: :destroy
Copy link
Member

Choose a reason for hiding this comment

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

Do the highlighted lines need to be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. In getting_started.md, the concern pp/models/product/notifications.rb already has the one:

module Product::Notifications extend ActiveSupport::Concern included do has_many :subscribers, dependent: :destroy # this should work after_update_commit :notify_subscribers, if: :back_in_stock? end

As far as I followed the steps in getting_started.md, the highlighted line has_many :subscribers, dependent: :destroy is unnecessary.

Copy link
Member

@skipkayhil skipkayhil Oct 24, 2025

Choose a reason for hiding this comment

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

I'm sorry, I should have been more specific: at the top of this code block is rb#5-6 which causes lines 5 through 6 to be highlighted in the generated guide. Since we're removing a line shouldn't we update which line numbers should be highlighted as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aha, now I get this😅 Yes, I should have also updated the highlight from 5-6 to 4-5. Just a moment.

@rafaelfranca rafaelfranca merged commit 6b75c95 into rails:main Oct 24, 2025
4 checks passed
rafaelfranca added a commit that referenced this pull request Oct 24, 2025
[ci-skip][doc] Fix typos and errors in wishlists.md
@hachi8833 hachi8833 deleted the update_wishlists branch October 24, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants