Sha256: 18558f1794a5df721b69c843af2d8a41ed7ad1da8b90ba2ab9ca094f7259d864

Contents?: true

Size: 431 Bytes

Versions: 13

Compression:

Stored size: 431 Bytes

Contents

module CanTango
  class Ability
    module CacheHelpers

      def cached_rules?
        caching_on? && cache.key.same?(session)
      end

      def cache_rules!
        cache.cache_rules!
      end

      def cached_rules
        cache.cached_rules
      end

      def cache
        @cache ||= Cache.new self
      end

      protected

      def caching_on?
        CanTango.config.cache_engine.on?
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cantango-0.8.9.5 lib/cantango/ability/cache_helpers.rb
cantango-0.8.9.4 lib/cantango/ability/cache_helpers.rb
cantango-0.8.9.3 lib/cantango/ability/cache_helpers.rb
cantango-0.8.9.2 lib/cantango/ability/cache_helpers.rb
cantango-0.8.9.1 lib/cantango/ability/cache_helpers.rb
cantango-0.8.9 lib/cantango/ability/cache_helpers.rb
cantango-0.8.8.1 lib/cantango/ability/cache_helpers.rb
cantango-0.8.8 lib/cantango/ability/cache_helpers.rb
cantango-0.8.7 lib/cantango/ability/cache_helpers.rb
cantango-0.8.6.2 lib/cantango/ability/cache_helpers.rb
cantango-0.8.6.1 lib/cantango/ability/cache_helpers.rb
cantango-0.8.6 lib/cantango/ability/cache_helpers.rb
cantango-0.8.5.1 lib/cantango/ability/cache_helpers.rb