Skip to content
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

Implement location details #5

Open
luanzeba opened this issue May 22, 2022 · 0 comments
Open

Implement location details #5

luanzeba opened this issue May 22, 2022 · 0 comments

Comments

@luanzeba
Copy link
Owner

luanzeba commented May 22, 2022

This is an intermediate to advanced change. I'd recommend taking a look at good first issues first if you're not too comfortable with Rails yet.

Problem statement

Our events do not specify a location at the moment. That's obviously a big problem for an event management app.

Solution

We should implement locations as a separate model. That will allow us to share the same location record among different events. For example, let's say the event RailsConf is happening at Oregon Convention Center. When we create that event, we will also create a location record for the Oregon Convention Center.
Then, a month later, Comic-Con schedules an event at the Oregon Convention Center. This time, we should use the existing location record.
This is powerful because it gives us the ability to find all events happening at a given location. We wouldn't have that power if we implemented location as just a string column in the events table.

Implementation details

  • Location should have its own model backed by a database table.
  • Location should belong_to events and an event should have_one location.
    • See video 14 - Creating a Registration Model (add link) for a refresher on setting up these relationships.
  • The location should have a name column, but I will leave it up to you on how you'd like to implement the address storage. I'd recommend doing some research and explaining the reasoning behind your recommendation.

I'd be happy to review your implementation when I have time. Please open a pull request following these steps:

  1. Follow this guide to setup your forked repo
  2. Checkout a development branch
  3. Implement your changes
  4. Open a pull request and tag me for review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant