diff --git a/app/controllers/api/v1_alpha/collections_controller.rb b/app/controllers/api/v1_alpha/collections_controller.rb index b6bb462a4b..65c08d8d6b 100644 --- a/app/controllers/api/v1_alpha/collections_controller.rb +++ b/app/controllers/api/v1_alpha/collections_controller.rb @@ -70,6 +70,7 @@ class Api::V1Alpha::CollectionsController < Api::BaseController def set_collections @collections = @account.collections + .with_tag .with_item_count .order(created_at: :desc) .offset(offset_param) diff --git a/app/models/collection.rb b/app/models/collection.rb index 4752c4cdd2..231f12ef52 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -44,6 +44,7 @@ class Collection < ApplicationRecord .left_joins(:collection_items) .group(collections: :id) } + scope :with_tag, -> { includes(:tag) } def remote? !local?