BikeBikeBike/app/models/city_cache.rb
2016-12-13 22:58:35 -08:00

14 lines
264 B
Ruby

class CityCache < ActiveRecord::Base
self.table_name = :city_cache
belongs_to :city
def self.search(str)
CityCache.find_by_search(str.downcase)
end
def self.cache(str, city_id)
CityCache.create(city_id: city_id, search: str.downcase)
end
end