Fix #4670: Replace RequestStore with AS::CurrentAttributes.

This also requires replacing CurrentUser.name with CurrentUser.user.name
because the `name` method had a conflict with CurrentAttributes.
This commit is contained in:
evazion
2021-01-16 12:43:20 -06:00
parent 6f6ec6592d
commit 6ca007ee1f
11 changed files with 32 additions and 91 deletions

View File

@@ -3,13 +3,13 @@
<%= subnav_link_to "Upload", new_upload_path %>
<%= subnav_link_to "Hot", posts_path(:tags => "order:rank", :d => "1") %>
<% if RecommenderService.available_for_user?(CurrentUser.user) %>
<%= subnav_link_to "Recommended", recommended_posts_path(search: { user_name: CurrentUser.name }) %>
<%= subnav_link_to "Recommended", recommended_posts_path(search: { user_name: CurrentUser.user.name }) %>
<% end %>
<% if policy(Favorite).create? %>
<%= subnav_link_to "Favorites", posts_path(tags: "ordfav:#{CurrentUser.user.name}") %>
<% end %>
<% if policy(FavoriteGroup).create? %>
<%= subnav_link_to "Fav groups", favorite_groups_path(search: { creator_name: CurrentUser.name }) %>
<%= subnav_link_to "Fav groups", favorite_groups_path(search: { creator_name: CurrentUser.user.name }) %>
<% end %>
<% if policy(SavedSearch).create? %>
<%= subnav_link_to "Saved searches", posts_path(tags: "search:all") %>