Smarter city search caching

This commit is contained in:
Godwin
2016-12-14 09:38:11 -08:00
committed by GitHub
parent 80000057a6
commit 02e349261c
+1 -1
View File
@@ -14,7 +14,7 @@ class CityCache < ActiveRecord::Base
end end
private private
def normalize_string(str) def self.normalize_string(str)
# remove accents, unnecessary whitespace, punctuation, and lowcase tje string # remove accents, unnecessary whitespace, punctuation, and lowcase tje string
I18n.transliterate(str).gsub(/[^\w\s]/, '').gsub(/\s\s+/, ' ').strip.downcase I18n.transliterate(str).gsub(/[^\w\s]/, '').gsub(/\s\s+/, ' ').strip.downcase
end end