pundit: convert posts to pundit.

This commit is contained in:
evazion
2020-03-20 01:55:51 -05:00
parent dd39913e55
commit a5418abb31
18 changed files with 178 additions and 95 deletions

View File

@@ -4,7 +4,7 @@ $("#score-for-post-<%= @post.id %>").text(<%= @post.score %>);
$("#favcount-for-post-<%= @post.id %>").text(<%= @post.fav_count %>);
$(".fav-buttons").toggleClass("fav-buttons-false").toggleClass("fav-buttons-true");
<% if CurrentUser.is_gold? %>
<% if policy(@post).can_view_favlist? %>
var fav_count = <%= @post.fav_count %>;
$("#favlist").html("<%= j post_favlist(@post) %>");