Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems like this line or something similar should be all that is needed to replace the original
request.path == path
check. Do we need the three checks?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.
if we only use
start_with
, 'Home' will also be selected when folks visit the Visits/Reports/Settings routes.if I knew as much about ruby as I do about JS I could have condensed the other two by separating the root of the default 'Visits' path from today's date, but I took the easy way out.
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 would probably work.
I'll find some time to make sure soon.
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.
nope, AFAICT, the two pesky routes below make it pretty tough to cram all the logic you'd need in without a third clause.
/[org]/reports
/[/org]/reports/visits
if
/[org]/reports/
was served up with a trailing slash, it'd be a different story.edit: I'm a bit hindered here by the fact that I don't even know how to set breakpoints or inspect variables in Ruby/Rails.
if I knew how to do that, I'd imagine I could split the path up using a regex to isolate the portion of the route that comes immediately after the organization name and compare that to the label instead.