favorites: convert user.hide_favorites? to pundit.

This commit is contained in:
evazion
2020-03-21 22:12:23 -05:00
parent 5bc82bf07b
commit 2445e8b82f
7 changed files with 25 additions and 18 deletions

View File

@@ -11,7 +11,7 @@
</div>
<% end %>
<% if presenter.has_favorites? && !user.hide_favorites? %>
<% if presenter.has_favorites? && policy(user).can_see_favorites? %>
<div class="box user-favorites">
<h2>
<%= link_to "Favorites", posts_path(tags: "ordfav:#{user.name}") %>