Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Invalidate cache when updating role (#1786)
  • Loading branch information
jessleenyc authored and maestromac committed Feb 13, 2019
1 parent 4f1a996 commit 7b21a3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/internal/users_controller.rb
Expand Up @@ -84,6 +84,8 @@ def toggle_trust_user
else
@user.remove_role :trusted
end
Rails.cache.delete("user-#{@user.id}/has_trusted_role")
@user.trusted
end

def toggle_warn_user
Expand Down
2 changes: 1 addition & 1 deletion app/views/internal/users/show.html.erb
Expand Up @@ -44,7 +44,7 @@
<p>(view full history in notes below)</p>
<ul>
<% @user.roles.each do |role| %>
<li><%= role.name %> - <em><%= role.created_at.strftime("%b %e '%y") %></em></li>
<li><%= role.name %> <em><%= "- " + Tag.find(role.resource_id).name if role.resource_id.present? %></em></li>
<% end %>
</ul>
<h3><u>Privileges</u></h3>
Expand Down

0 comments on commit 7b21a3a

Please sign in to comment.