aub-cache_advance 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/cache_advance.gemspec +1 -1
  2. data/rails/init.rb +13 -4
  3. metadata +1 -1
@@ -1,5 +1,5 @@
1
1
  Gem::Specification.new do |s|
2
- s.version = '1.0.5'
2
+ s.version = '1.0.6'
3
3
  s.date = %q{2009-01-08}
4
4
 
5
5
  s.name = %q{cache_advance}
data/rails/init.rb CHANGED
@@ -10,10 +10,19 @@ require 'config/caches'
10
10
  require 'dispatcher'
11
11
 
12
12
  # This is the helper method that can be used in rails views/controllers/helpers.
13
- ActionController::Base.helper do
14
- def cache_it(cache, options={}, &block)
15
- CacheAdvance::Caches.apply(cache, request, options) do
16
- capture(&block)
13
+ # If caching is disabled, just make it yield the results of the block.
14
+ if config.action_controller.perform_caching
15
+ ActionController::Base.helper do
16
+ def cache_it(cache, options={}, &block)
17
+ CacheAdvance::Caches.apply(cache, request, options) do
18
+ capture(&block)
19
+ end
20
+ end
21
+ end
22
+ else
23
+ ActionController::Base.helper do
24
+ def cache_it(cache, options={})
25
+ yield
17
26
  end
18
27
  end
19
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aub-cache_advance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aubrey Holland