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
mack-active_record-0.8.3 lib/gems/activerecord-2.2.2/lib/active_record/query_cache.rb
radiant-0.6.5.1 vendor/rails/activerecord/lib/active_record/query_cache.rb
radiant-0.6.5 vendor/rails/activerecord/lib/active_record/query_cache.rb
radiant-0.6.6 vendor/rails/activerecord/lib/active_record/query_cache.rb
radiant-0.6.7 vendor/rails/activerecord/lib/active_record/query_cache.rb
radiant-0.6.8 vendor/rails/activerecord/lib/active_record/query_cache.rb
radiant-0.6.9 vendor/rails/activerecord/lib/active_record/query_cache.rb
radiant-0.7.0 vendor/rails/activerecord/lib/active_record/query_cache.rb
radiant-0.7.1 vendor/rails/activerecord/lib/active_record/query_cache.rb
spree-0.0.9 vendor/rails/activerecord/lib/active_record/query_cache.rb
spree-0.2.0 vendor/rails/activerecord/lib/active_record/query_cache.rb