Sha256: 6d2337aebc180a6996b576324d5c116b272fd00eb06dfee2ab6b0ba1f7a67a15

Contents?: true

Size: 848 Bytes

Versions: 8

Compression:

Stored size: 848 Bytes

Contents

# -*- encoding : utf-8 -*-
module SecondLevelCache
  module ActiveRecord
    module Persistence
      extend ActiveSupport::Concern

      included do
        class_eval do
          alias_method_chain :reload, :second_level_cache
          alias_method_chain :touch, :second_level_cache
          alias_method_chain :update_column, :second_level_cache
        end
      end

      def update_column_with_second_level_cache(name, value)
        update_column_without_second_level_cache(name, value).tap{update_second_level_cache}
      end

      def reload_with_second_level_cache(options = nil)
        reload_without_second_level_cache(options).tap{expire_second_level_cache}
      end

      def touch_with_second_level_cache(name = nil)
        touch_without_second_level_cache(name).tap{update_second_level_cache}
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
second_level_cache-2.1.0.rc2 lib/second_level_cache/active_record/persistence.rb
second_level_cache-2.1.0.rc1 lib/second_level_cache/active_record/persistence.rb
second_level_cache-2.0.0 lib/second_level_cache/active_record/persistence.rb
second_level_cache-2.0.0.rc1 lib/second_level_cache/active_record/persistence.rb
second_level_cache-2.0.0.beta lib/second_level_cache/active_record/persistence.rb
second_level_cache-1.6.2 lib/second_level_cache/active_record/persistence.rb
second_level_cache-1.6.1 lib/second_level_cache/active_record/persistence.rb
second_level_cache-1.6.0 lib/second_level_cache/active_record/persistence.rb