#2335 normalize for search too
This commit is contained in:
@@ -9,11 +9,15 @@ class SavedSearch < ActiveRecord::Base
|
|||||||
before_validation :normalize
|
before_validation :normalize
|
||||||
|
|
||||||
def self.tagged(tags)
|
def self.tagged(tags)
|
||||||
where(:tag_query => tags).first
|
where(:tag_query => SavedSearch.normalize(tags)).first
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.normalize(tag_query)
|
||||||
|
Tag.scan_query(tag_query).join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize
|
def normalize
|
||||||
self.tag_query = Tag.scan_query(tag_query).join(" ")
|
self.tag_query = SavedSearch.normalize(tag_query)
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_count
|
def validate_count
|
||||||
|
|||||||
Reference in New Issue
Block a user