Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Commit

Permalink
Mod: 修正上次提交修正Ruby那个没有转换小写的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Apr 2, 2011
1 parent 00289e6 commit 37677ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ask.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 37677ac

Please sign in to comment.