lib/cacheable.rb in simple_cacheable-1.3.3 vs lib/cacheable.rb in simple_cacheable-1.4.0
- old
+ new
@@ -6,19 +6,23 @@
module Cacheable
def self.included(base)
base.extend(Cacheable::Caches)
base.send :include, Cacheable::Keys
base.send :include, Cacheable::Expiry
-
+ base.send :extend, ClassMethods
base.class_eval do
- def self.model_cache(&block)
- class_attribute :cached_key,
+ class_attribute :cached_key,
:cached_indices,
:cached_methods,
:cached_class_methods,
:cached_associations
- instance_exec &block
- end
+ end
+
+ end
+
+ module ClassMethods
+ def model_cache(&block)
+ instance_exec &block
end
end
end