Sha256: aa15cd2ce4b7ebc4075e32f7e44f8d3978250ee11a2753fdbb73a8ff52dd4acd

Contents?: true

Size: 450 Bytes

Versions: 2

Compression:

Stored size: 450 Bytes

Contents

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

      included do
        class << self
          alias_method_chain :find, :cache
        end

      end

      module ClassMethods
        def find_with_cache(*ids)
          return all.find(ids.first) if ids.size == 1 && ids.first.is_a?(Integer)
          find_without_cache(*ids)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
second_level_cache-2.1.16 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.15 lib/second_level_cache/active_record/core.rb