Sha256: 3e67f4b8d0c683ef383b5c2476bcd2c226e3c49f49e5de5cb2000ac29eda959a

Contents?: true

Size: 449 Bytes

Versions: 9

Compression:

Stored size: 449 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?(Fixnum)
          find_without_cache(*ids)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
second_level_cache-2.1.14 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.13 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.10 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.9 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.8 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.7 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.6 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.5 lib/second_level_cache/active_record/core.rb
second_level_cache-2.1.2 lib/second_level_cache/active_record/core.rb