From 8f0038c3ff2b634f2f3433d09c4e6f5b92189a1c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Mar 2016 17:06:59 +0800 Subject: [PATCH] tag --- app/helpers/courses_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 36eebe4f2..64531a6f4 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -24,7 +24,7 @@ module CoursesHelper def find_excelletn_course keywords, current_course # 获取tag匹配结果ID a_tags = [] - Course.where("is_excellent =? and is_public =?", 1, 1).includes(:tags).each do |ec| + Course.where("is_excellent =? and is_public =?", 1, 1).each do |ec| if ec.tags.any?{|value| current_course.name.include?(value.to_s)} a_tags << ec.id end