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

add fix for duplicate stops #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jonglass82
Copy link
Collaborator

Closes #19 Fix Duplicate Stops

In our Lines#show view 'show.html.erb', I have updated line 13 where we call @line.stops to @line.stops.uniq. My thought is if all we are doing with this query is rendering stops from a specific line, the .uniq will take care of eliminating any duplicate stops rendered to the user.

We can also keep our current @line query in place in our #show method in the Lines Controller.

Manual testing was done by Identifying Lines in my local database that rendered duplicate stops, then implemented the change, then revisited the show view for those lines and saw the duplicates were removed.

Checklist:

  • Code follows code style of this project
  • Tests added to cover changes
  • All new and existing tests passing

@ajblaida
Copy link
Contributor

I'm not terribly familiar with this issue, so first and foremost, which line did you test this on? Secondly, this makes sense to fix up this view but we may need to do some further investigation on getting rid of the problem at the database level. I can think that at least the issues _form partial will have a list of stops which likely also has that duplication issue

@jonglass82
Copy link
Collaborator Author

The data in my local database came from the suggested transit operator to use for testing in the readme:

rake transit:set_up_transitland TLAND_AGENCY_ONESTOP_ID=o-drke-9towntransit

The line I tested was the 'Maggio Inlet' line. The duplicate stop on that line was 'Hettinger Glen'. When I added the .uniq method to @line.stops in the Lines#show view, the duplication of 'Hettinger Glen' was fixed.

I agree with further investigation and I would like to take a closer look at this issue at the database level and understand why the duplication is occurring when the initial data is populated. Then maybe I can demonstrate and discuss further on Tuesday.

@tkimia
Copy link
Collaborator

tkimia commented Jan 25, 2020

@jonglass82 This is a fine solution, but I'd love to talk with you and the others about a new model that will fix this issue and others. Hope you can make it on Tuesday!

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

Successfully merging this pull request may close these issues.

Fix Duplicate Stops
3 participants