don't recompute activators on each field

This commit is contained in:
Andrew Brown 2018-09-21 14:06:36 -05:00
parent a7abb3e66f
commit 1065721e72

View File

@ -53,7 +53,7 @@
<span class="grey-text" style="padding-top: 6px; padding-right: 4px;">
Link a page (<a href="#" class="tooltipped" data-tooltip="These links will insert a small snippet where you're typing<br />that automatically turns into a link to that page after saving." data-position="bottom" data-html="true">?</a>):
</span>
<% (current_user.user_content_type_activators.pluck(:content_type) - ["Universe"]).each do |class_name| %>
<% @linkables_cache.keys.each do |class_name| %>
<% relation_class = class_name.constantize %>
<a class="btn btn-small <%= relation_class.color %> dropdown-trigger <%= 'disabled' unless @linkables_cache.fetch(class_name, []).any? %>"
href="#" style="padding: 0 9px;"