diff --git a/app/models/concerns/has_attributes.rb b/app/models/concerns/has_attributes.rb index 430d8082..cdd1b939 100644 --- a/app/models/concerns/has_attributes.rb +++ b/app/models/concerns/has_attributes.rb @@ -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 diff --git a/app/views/content/display/_sidelinks.html.erb b/app/views/content/display/_sidelinks.html.erb index 45967d63..f652af30 100644 --- a/app/views/content/display/_sidelinks.html.erb +++ b/app/views/content/display/_sidelinks.html.erb @@ -16,7 +16,7 @@ <% 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