diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 92845f7b9..d0b8d67d9 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -20,8 +20,8 @@ class HomeController < ApplicationController shixuns = shixuns.where(homepage_show: true) subjects = subjects.where(homepage_show: true) else - shixuns = shixuns.joins(:laboratory_shixuns).where(laboratory_shixuns: { homepage: true }) - subjects = subjects.joins(:laboratory_subjects).where(laboratory_subjects: { homepage: true }) + shixuns = shixuns.joins(:laboratory_shixuns).where(laboratory_shixuns: { homepage: true, laboratory_id: current_laboratory.id}) + subjects = subjects.joins(:laboratory_subjects).where(laboratory_subjects: { homepage: true, laboratory_id: current_laboratory.id}) end @shixuns = shixuns.includes(:tag_repertoires, :challenges).limit(8)