erector-rails4 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/erector/caching.rb +7 -1
- data/lib/erector/version.rb +1 -1
- data/spec/dummy/config/environments/development.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76617a89c514165596b405b26b4d478954e8d2f4
|
4
|
+
data.tar.gz: 8918a4e0c6781101c4d5535af2dc8c9948c509c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 175007a5293001ebfba00e9fd7c80a2a89826a89b55227cb7328eac9c923e23827e1227ba81bf54481aabfdb421ee0963140c1ccb665b78f211016b43335546b
|
7
|
+
data.tar.gz: ec15d388ca8691a1d67423207c1e4cffb59e2711b187784f5fe8760430039b03314471c2c8efeacfb65db6b14867b7d6995b5e8977a914eaf53e14aa3a0f4339
|
data/Gemfile.lock
CHANGED
data/lib/erector/caching.rb
CHANGED
@@ -37,13 +37,19 @@ module Erector
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def should_cache?
|
40
|
-
if block.nil? && self.class.cachable?
|
40
|
+
if block.nil? && self.class.cachable? && caching_configured?
|
41
41
|
true
|
42
42
|
else
|
43
43
|
false
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
def caching_configured?
|
48
|
+
return true if !defined?(Rails)
|
49
|
+
::Rails.configuration.action_controller.perform_caching &&
|
50
|
+
::Rails.configuration.action_controller.cache_store
|
51
|
+
end
|
52
|
+
|
47
53
|
protected
|
48
54
|
def _emit(options = {})
|
49
55
|
if should_cache?
|
data/lib/erector/version.rb
CHANGED
@@ -12,7 +12,7 @@ Dummy::Application.configure do
|
|
12
12
|
# Show full error reports and disable caching
|
13
13
|
config.consider_all_requests_local = true
|
14
14
|
config.action_view.debug_rjs = true
|
15
|
-
config.action_controller.perform_caching =
|
15
|
+
config.action_controller.perform_caching = true
|
16
16
|
|
17
17
|
# Don't care if the mailer can't send
|
18
18
|
config.action_mailer.raise_delivery_errors = false
|
@@ -18,7 +18,7 @@ Dummy::Application.configure do
|
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
20
20
|
config.consider_all_requests_local = true
|
21
|
-
config.action_controller.perform_caching =
|
21
|
+
config.action_controller.perform_caching = true
|
22
22
|
|
23
23
|
# Raise exceptions instead of rendering exception templates.
|
24
24
|
config.action_dispatch.show_exceptions = false
|