From 37677ace7bf8e82a7060e929ddfe2d8ad8d9bffa Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Sat, 2 Apr 2011 16:15:19 +0800 Subject: [PATCH] =?UTF-8?q?Mod:=20=E4=BF=AE=E6=AD=A3=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=AD=A3Ruby=E9=82=A3=E4=B8=AA?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=BD=AC=E6=8D=A2=E5=B0=8F=E5=86=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/ask.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ask.rb b/app/models/ask.rb index f8ff622..b248cf0 100644 --- a/app/models/ask.rb +++ b/app/models/ask.rb @@ -111,7 +111,7 @@ def self.search_title(text,options = {}) words = [] result.raw_result[:words].each do |w| next if w[0] == "ask" - words << ((w[0] == "rubi" and text.index("ruby")) ? "ruby" : w[0]) + words << ((w[0] == "rubi" and text.downcase.index("ruby")) ? "ruby" : w[0]) end out_result = {:items => [], :words => words} out_result[:items] = Ask.all_in(:title => words.collect { |w| /#{w}/i }).recent.normal.limit(limit)