fixes #172: OR tag searching doesn't work

This commit is contained in:
albert
2011-11-01 18:03:43 -04:00
parent 97520bd01b
commit 71da9cbc4c

View File

@@ -191,6 +191,9 @@ class Tag < ActiveRecord::Base
if tag[0] == "-" && tag.size > 1
output[:exclude] << tag[1..-1]
elsif tag[0] == "~" && tag.size > 1
output[:include] << tag[1..-1]
elsif tag =~ /\*/
matches = Tag.name_matches(tag).all(:select => "name", :limit => 25, :order => "post_count DESC").map(&:name)
matches = ["~no_matches~"] if matches.empty?