added check for empty seach

This commit is contained in:
Aaro Koivukangas
2023-11-16 15:31:11 +02:00
parent 726ecd3e2b
commit 727b95dd00
+4
View File
@@ -1,6 +1,10 @@
class BeermappingApi
def self.places_in(city)
city = city.downcase
# gets caught by places.empty?
# TODO fix error message, No locations in ""
return "" if city == ""
Rails.cache.fetch(city, expires_in: 1.week) { get_places_in city }
end