diff --git a/app/controllers/libraries_controller.rb b/app/controllers/libraries_controller.rb index b7bbf836..ac861841 100644 --- a/app/controllers/libraries_controller.rb +++ b/app/controllers/libraries_controller.rb @@ -23,7 +23,7 @@ class LibrariesController < ApplicationController per_page = params[:per_page].to_i <= 0 ? 20 : params[:per_page].to_i @libraries = paginateHelper libraries.includes(:library_tags, :praise_tread_cache, user: :user_extensions), per_page - @download_count_map = Attachment.where(container_type: 'Library', container_id: @libraries.map(&:id)).group(:container_id).count + @download_count_map = Attachment.where(container_type: 'Library', container_id: @libraries.map(&:id)).group(:container_id).sum(:downloads) end def show