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.
- data/lib/model_cache.rb +7 -5
- 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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|