-
Notifications
You must be signed in to change notification settings - Fork 22k
[RF-DOCS] Wishlists guide #55428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[RF-DOCS] Wishlists guide #55428
Conversation
This guide covers adding Wishlists to the store e-commerce application in the | ||
[Getting Started Guide](getting_started.html)). We will use the code from the | ||
[Sign up and Settings Guide](sign_up_and_settings.html) as a starting place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wishlist: have all the code from the previous guides ready so I don't have to follow them all before starting this one haha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That isn't a bad idea. Maybe we should put the getting started code in a repository that people can clone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A problem is that the repo would get out of sync as we update the tutorials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This came up in conversation with @excid3 when we were updating the Getting Started Guide, but the longterm maintenance as @MatheusRich says would be an issue.
@rafaelfranca Could this be in the Rails GitHub or would do you think an external repo is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an external repo. There are ways to make maintenance easier. We could write a script that generate the repo and keep it inside the repo and make sure its content is the same as the guide.
This guide covers adding Wishlists to the store e-commerce application in the | ||
[Getting Started Guide](getting_started.html)). We will use the code from the | ||
[Sign up and Settings Guide](sign_up_and_settings.html) as a starting place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That isn't a bad idea. Maybe we should put the getting started code in a repository that people can clone?
```ruby | ||
class Wishlist < ApplicationRecord | ||
belongs_to :user | ||
has_many :wishlist_products, dependent: :destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the proper name for this association and the model would be wishlisted_products
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be, if you think of this as an adjective ("products that were wishlisted"), but wishlist_products also work as "products that are on a wishlist".
guides/source/wishlists.md
Outdated
require "test_helper" | ||
|
||
class WishlistTest < ActiveSupport::TestCase | ||
test "has friendly urls" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK how I feel about this test. This seems mostly to be testing Rails code (which we should assume is tested). Maybe we could test that we can find it? Or maybe no test for this at all, since the integration specs will catch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'll swap this with a test for filter_by
since that is something actually worth unit testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @excid3! Great tutorial, as always. I learned something new today!
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Matheus Richard <matheusrichardt@gmail.com>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
Motivation / Background
This adds a new tutorial adding Wishlists to the e-commerce store as a follow-up to the Sign Up & Settings Guide. It builds upon the Rails knowledge learned so far and helps reinforce the concepts learned so far.
cc @AmandaPerino
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]