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
radiant-0.7.2 vendor/rails/activerecord/lib/active_record/query_cache.rb
vibes-bj-1.2.2 spec/rails_root/vendor/rails/activerecord/lib/active_record/query_cache.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/activerecord/lib/active_record/query_cache.rb
nbudin-castronaut-0.7.5 vendor/activerecord/lib/active_record/query_cache.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activerecord/pkg/activerecord-2.2.2/lib/active_record/query_cache.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activerecord/lib/active_record/query_cache.rb
factorylabs-castronaut-0.7.5 vendor/activerecord/lib/active_record/query_cache.rb
activerecord-2.2.3 lib/active_record/query_cache.rb
activerecord-2.0.1 lib/active_record/query_cache.rb
activerecord-2.0.5 lib/active_record/query_cache.rb
activerecord-2.0.4 lib/active_record/query_cache.rb
activerecord-2.0.2 lib/active_record/query_cache.rb
activerecord-2.1.0 lib/active_record/query_cache.rb
activerecord-2.1.1 lib/active_record/query_cache.rb
activerecord-2.2.2 lib/active_record/query_cache.rb
activerecord-2.1.2 lib/active_record/query_cache.rb
antfarm-0.3.0 rails/vendor/rails/activerecord/lib/active_record/query_cache.rb
antfarm-0.4.0 rails/vendor/rails/activerecord/lib/active_record/query_cache.rb
mack-active_record-0.8.2 lib/gems/activerecord-2.2.2/lib/active_record/query_cache.rb
mack-active_record-0.8.3.1 lib/gems/activerecord-2.2.2/lib/active_record/query_cache.rb