diff --git a/app/controllers/stores_controller.rb b/app/controllers/stores_controller.rb index d8d7346d3..b8e37bee7 100644 --- a/app/controllers/stores_controller.rb +++ b/app/controllers/stores_controller.rb @@ -11,11 +11,11 @@ class StoresController < ApplicationController def index # @projects_attach = project_classification(0).take(LIMIT) # @courses_attach = project_classification(1).take(LIMIT) - @projects_attach = Attachment.includes(:project).where("projects.project_type=?", 0). + @projects_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 0, 1). reorder("#{Attachment.table_name}.downloads DESC"). limit(LIMIT) - @courses_attach = Attachment.includes(:project).where("projects.project_type=?", 1). + @courses_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 1, 1). reorder("#{Attachment.table_name}.downloads DESC"). limit(LIMIT) @homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'"). diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb index ee7cda629..9ff68ec3f 100644 --- a/app/views/stores/index.html.erb +++ b/app/views/stores/index.html.erb @@ -87,7 +87,7 @@
<% k.each do |c1|%>