Sha256: b97e9eba53cdb0ca09bb51db7fbddfee2e5e644209553fa29a4db34bd14df325

Contents?: true

Size: 362 Bytes

Versions: 2

Compression:

Stored size: 362 Bytes

Contents

module MongoMapper
  module Plugins
    module AttributeCache
      extend ActiveSupport::Concern
      
      module InstanceMethods
        def cache
          @cache ||= {}
        end

        def clear_cache
          @cache = {}
        end

        def reload
          @cache.clear if @cache
          super
        end
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongo_mapper_ext-0.2.4 lib/mongo_mapper_ext/mongo_mapper/plugins/attribute_cache.rb
mongo_mapper_ext-0.2.3 lib/mongo_mapper_ext/plugins/attribute_cache.rb