[deploy] Tweak How We Track Ambiguous Routes to Make them Easier to Track (#8112)

This commit is contained in:
Molly Struve 2020-05-28 10:34:39 -05:00 committed by GitHub
parent 530b13e8c7
commit 07f8964007
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -197,10 +197,10 @@ class ArticlesController < ApplicationController
def handle_user_or_organization_feed
if (@user = User.find_by(username: params[:username]))
Honeycomb.add_field("articles_route.user", true)
Honeycomb.add_field("articles_route", "user")
@articles = @articles.where(user_id: @user.id)
elsif (@user = Organization.find_by(slug: params[:username]))
Honeycomb.add_field("articles_route.org", true)
Honeycomb.add_field("articles_route", "org")
@articles = @articles.where(organization_id: @user.id).includes(:user)
end
end

View file

@ -105,16 +105,16 @@ class StoriesController < ApplicationController
@organization = Organization.find_by(slug: params[:username])
@page = Page.find_by(slug: params[:username], is_top_level_path: true)
if @podcast
Honeycomb.add_field("stories_route.podcast", true)
Honeycomb.add_field("stories_route", "podcast")
handle_podcast_index
elsif @organization
Honeycomb.add_field("stories_route.org", true)
Honeycomb.add_field("stories_route", "org")
handle_organization_index
elsif @page
Honeycomb.add_field("stories_route.page", true)
Honeycomb.add_field("stories_route", "page")
handle_page_display
else
Honeycomb.add_field("stories_route.user", true)
Honeycomb.add_field("stories_route", "user")
handle_user_index
end
end