diff --git a/lib/geocoder.rb b/lib/geocoder.rb index 4019e84523f5f00a5ab6e31aebd233804ba5743d..b3bae2bff6f1899aff6b258e4d6b70612b959555 100644 --- a/lib/geocoder.rb +++ b/lib/geocoder.rb @@ -43,10 +43,8 @@ module Geocoder # The working Cache object, or +nil+ if none configured. # def cache - if @cache.nil? and store = Configuration.cache - @cache = Cache.new(store, Configuration.cache_prefix) - end - @cache + warn "WARNING: Calling Geocoder.cache is DEPRECATED. The #cache method now belongs to the Geocoder::Lookup object." + Geocoder::Lookup.get(Geocoder.config.lookup).send(:configuration).cache end end diff --git a/lib/geocoder/lookups/base.rb b/lib/geocoder/lookups/base.rb index f18742485ee501feb9be283187b6caf9e72d8302..821a87b96a8e561e3cee28a7a7f95b5e0e1b2fe4 100644 --- a/lib/geocoder/lookups/base.rb +++ b/lib/geocoder/lookups/base.rb @@ -230,7 +230,10 @@ module Geocoder # The working Cache object. # def cache - Geocoder.cache + if @cache.nil? and store = configuration.cache + @cache = Cache.new(store, configuration.cache_prefix) + end + @cache end ##