lib/active_support/cache.rb in activesupport-3.0.0.rc2 vs lib/active_support/cache.rb in activesupport-3.0.0

- old
+ new

@@ -56,10 +56,17 @@ store, *parameters = *Array.wrap(store_option).flatten case store when Symbol store_class_name = store.to_s.camelize - store_class = ActiveSupport::Cache.const_get(store_class_name) + store_class = + begin + require "active_support/cache/#{store}" + rescue LoadError + raise "Could not find cache store adapter for #{store} (#{$!})" + else + ActiveSupport::Cache.const_get(store_class_name) + end store_class.new(*parameters) when nil ActiveSupport::Cache::MemoryStore.new else store