rails-settings-cached 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails-settings/cached_settings.rb +8 -4
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a39928c852dc7324af7486277203647a7b325bd
|
4
|
+
data.tar.gz: 002dc0d372dd40be1fbca78c0d50e8fd22cee335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e7a7d055e200c97d604a4bfdf8576dfc8504bcee559a1c1fc471d4b69f859d7756b9ae3b0531111aa2d233be65a0ba901a166445235626613555713934775e7
|
7
|
+
data.tar.gz: fc9bf7d4d30a2060f8b22a800682834901c4cedd2551332ed07c12a0af70dca3ab9a3af4b2105572f43397bf94c9c26f94565852692f0c451160528f00ba1f1c
|
@@ -20,11 +20,15 @@ module RailsSettings
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def [](var_name)
|
23
|
-
|
24
|
-
|
23
|
+
value = Rails.cache.fetch(cache_key(var_name, @object)) do
|
24
|
+
super(var_name)
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
if value.nil?
|
28
|
+
@@defaults[var_name.to_s] if value.nil?
|
29
|
+
else
|
30
|
+
value
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
def save_default(key, value)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-settings-cached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Squeegy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-09-
|
14
|
+
date: 2015-09-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -27,6 +27,20 @@ dependencies:
|
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 4.2.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
type: :development
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
30
44
|
- !ruby/object:Gem::Dependency
|
31
45
|
name: rspec
|
32
46
|
requirement: !ruby/object:Gem::Requirement
|