mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
added check for empty seach
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user