Sha256: 2aeeebd9e607179cc25ce2609c911f5ab3773fa64ff53ee9c8a17532a34e108f

Contents?: true

Size: 510 Bytes

Versions: 51

Compression:

Stored size: 510 Bytes

Contents

module ActiveRecord
  module QueryCache
    # Enable the query cache within the block if Active Record is configured.
    def cache(&block)
      if ActiveRecord::Base.configurations.blank?
        yield
      else
        connection.cache(&block)
      end
    end

    # Disable the query cache within the block if Active Record is configured.
    def uncached(&block)
      if ActiveRecord::Base.configurations.blank?
        yield
      else
        connection.uncached(&block)
      end
    end
  end
end

Version data entries

51 entries across 50 versions & 13 rubygems

Version Path
3mix-castronaut-0.5.0.2 vendor/activerecord/lib/active_record/query_cache.rb
masover-castronaut-0.4.4.4 vendor/activerecord/lib/active_record/query_cache.rb
masover-castronaut-0.4.4.5 vendor/activerecord/lib/active_record/query_cache.rb
masover-castronaut-0.5.0.1 vendor/activerecord/lib/active_record/query_cache.rb
p8-castronaut-0.6.1.1 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.4.1 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.4.2 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.4.3 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.4.4 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.4.5 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.4.6 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.5.0 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.5.1 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.5.2 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.5.3 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.5.4 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.6.0 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.6.1 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.7.4 vendor/activerecord/lib/active_record/query_cache.rb
relevance-castronaut-0.7.5 vendor/activerecord/lib/active_record/query_cache.rb