fix sidelinks for hidden categories

This commit is contained in:
Andrew Brown 2018-08-18 16:55:15 -05:00
parent fe3ce777ee
commit 83e0080db6
2 changed files with 3 additions and 2 deletions

View File

@ -40,7 +40,8 @@ module HasAttributes
end.compact
if categories.first&.user&.present?
categories.first.user.attribute_categories.where(entity_type: self.content_name, hidden: [false, nil])
acceptable_hidden_values = show_hidden ? [true, false, nil] : [false, nil]
categories.first.user.attribute_categories.where(entity_type: self.content_name, hidden: acceptable_hidden_values)
else
categories
end

View File

@ -16,7 +16,7 @@
</li>
<% end %>
<% @content.class.attribute_categories(@content.user).each do |category| %>
<% @content.class.attribute_categories(creating ? current_user : @content.user).each do |category| %>
<% fields = category.attribute_fields %>
<%
#TODO: refactor ALL OF THIS