diff --git a/app/models/category_list.rb b/app/models/category_list.rb index 1b2662650..421dac576 100644 --- a/app/models/category_list.rb +++ b/app/models/category_list.rb @@ -55,7 +55,7 @@ class CategoryList # Find a list of all categories to associate the topics with def find_categories @categories = Category - .includes(:featured_users, subcategories: [:topic_only_relative_url]) + .includes(:featured_users, :topic_only_relative_url, subcategories: [:topic_only_relative_url]) .secured(@guardian) if @options[:parent_category_id].present? diff --git a/app/serializers/basic_category_serializer.rb b/app/serializers/basic_category_serializer.rb index cce1ee3f4..e80ce8dc6 100644 --- a/app/serializers/basic_category_serializer.rb +++ b/app/serializers/basic_category_serializer.rb @@ -28,6 +28,7 @@ class BasicCategorySerializer < ApplicationSerializer def can_edit true end + def include_can_edit? scope && scope.can_edit?(object) end diff --git a/app/serializers/category_detailed_serializer.rb b/app/serializers/category_detailed_serializer.rb index 806fbd16e..531c01435 100644 --- a/app/serializers/category_detailed_serializer.rb +++ b/app/serializers/category_detailed_serializer.rb @@ -26,7 +26,7 @@ class CategoryDetailedSerializer < BasicCategorySerializer end def include_displayable_topics? - return displayable_topics.present? + displayable_topics.present? end def description_excerpt diff --git a/app/serializers/listable_topic_serializer.rb b/app/serializers/listable_topic_serializer.rb index bf7927382..0ccce9452 100644 --- a/app/serializers/listable_topic_serializer.rb +++ b/app/serializers/listable_topic_serializer.rb @@ -23,6 +23,7 @@ class ListableTopicSerializer < BasicTopicSerializer :notification_level has_one :last_poster, serializer: BasicUserSerializer, embed: :objects + def include_last_poster? object.include_last_poster end