model-cache 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/model_cache.rb +7 -5
  2. metadata +1 -1
data/lib/model_cache.rb CHANGED
@@ -27,11 +27,13 @@ module ModelCache
27
27
  unless cache_hit
28
28
  result = block.call
29
29
  if Rails.configuration.action_controller.perform_caching
30
- if result
31
- CACHE.set(ckey, result, time)
32
- else
33
- CACHE.set(ckey, NIL_OBJECT, time)
34
- end
30
+ begin
31
+ if result
32
+ CACHE.set(ckey, result, time)
33
+ else
34
+ CACHE.set(ckey, NIL_OBJECT, time)
35
+ end
36
+ end rescue nil
35
37
  end
36
38
  result
37
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frantisek Havluj