lib/cantango/ability/cache_helpers.rb in cantango-0.9.3.2 vs lib/cantango/ability/cache_helpers.rb in cantango-0.9.4
- old
+ new
@@ -1,22 +1,13 @@
module CanTango
class Ability
module CacheHelpers
+ include CanTango::Helpers::RoleMethods
- def cached_rules?
- cache.key.same?(session)
- end
+ delegate :cache_rules!, :cached_rules, :cached_rules?, :to => :cache
- def cache_rules!
- cache.cache_rules!
- end
-
- def cached_rules
- cache.cached_rules
- end
-
- def cache
- @cache ||= Cache.new self
+ def cache options = {}
+ @cache ||= CanTango::Ability::Cache.new self, options
end
end
end
end