From 0cd20c6b62728728678b0c77a1c49704bd7be1b2 Mon Sep 17 00:00:00 2001 From: jasder Date: Thu, 4 Jul 2019 10:13:53 +0800 Subject: [PATCH] FIX update files publish count --- app/controllers/files_controller.rb | 4 ++-- app/views/files/index.json.jbuilder | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 05a9ab841..b75020643 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -23,8 +23,8 @@ class FilesController < ApplicationController get_category(@course, course_second_category_id) @total_count = @attachments.size - @public_count = @attachments.publiced.size - @private_count = @total_count - @public_count + @publish_count = @attachments.published.size + @unpublish_count = @total_count - @publish_count @attachments = @attachments.by_keywords(params[:search]) @attachments = diff --git a/app/views/files/index.json.jbuilder b/app/views/files/index.json.jbuilder index 03b4d4892..81fa406dd 100644 --- a/app/views/files/index.json.jbuilder +++ b/app/views/files/index.json.jbuilder @@ -3,8 +3,8 @@ json.data do json.id @category_id json.name @category_name json.total_count @total_count - json.public_count @public_count - json.private_count @private_count + json.publish_count @publish_count + json.unpublish_count @unpublish_count json.course_is_public @course.is_public? json.files do json.array! @attachments do |attachment|