lib/kasket.rb in kasket-0.8.1 vs lib/kasket.rb in kasket-0.8.2
- old
+ new
@@ -12,11 +12,11 @@
CONFIGURATION = {:max_collection_size => 100}
class Version
MAJOR = 0
MINOR = 8
- PATCH = 1
+ PATCH = 2
STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
end
module_function
@@ -27,11 +27,20 @@
ActiveRecord::Associations::BelongsToAssociation.send(:include, Kasket::ReloadAssociationMixin)
ActiveRecord::Associations::BelongsToPolymorphicAssociation.send(:include, Kasket::ReloadAssociationMixin)
ActiveRecord::Associations::HasOneThroughAssociation.send(:include, Kasket::ReloadAssociationMixin)
end
+ def self.cache_store=(options)
+ @cache_store = ActiveSupport::Cache.lookup_store(options)
+ end
+
+ def self.cache
+ @cache_store ||= Rails.cache
+ end
+
def clear_local
- if Rails.cache.respond_to?(:with_local_cache)
- Rails.cache.send(:local_cache).try(:clear)
+ if Kasket.cache.respond_to?(:with_local_cache)
+ Kasket.cache.send(:local_cache).try(:clear)
end
end
end
+