rails-settings-cached 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/rails-settings/cached_settings.rb +9 -0
- data/lib/rails-settings/settings.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 573145ca5a45516e138312ff9b35338e97b2a12b
|
4
|
+
data.tar.gz: 4e55fec2760056d075ae1cd330d5d26cc6cd7a0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5844cac704005e2d797f1e6d9bcd770f480f84f3ee5eba29aae25f4a0e67466863ff14cdd94b2e95e955a5a07a8d19c85b31cfdb7318f141b42772e877147e03
|
7
|
+
data.tar.gz: f9dcf649734ed373921eaab2fee33257beb68e785841268c4eba98c1bb610172647bec696dd911a70f489852fc30bfe1aee1bf0f46c3065018f68c9d2ee66048
|
data/README.md
CHANGED
@@ -9,8 +9,7 @@ of object. Strings, numbers, arrays, or any object.
|
|
9
9
|
|
10
10
|
## Status
|
11
11
|
|
12
|
-
|
13
|
-
- [![CI Status](https://api.travis-ci.org/huacnlee/rails-settings-cached.png)](http://travis-ci.org/huacnlee/rails-settings-cached)
|
12
|
+
[![Gem Version](https://badge.fury.io/rb/rails-settings-cached.svg)](https://rubygems.org/gems/rails-settings-cached) [![CI Status](https://api.travis-ci.org/huacnlee/rails-settings-cached.svg)](http://travis-ci.org/huacnlee/rails-settings-cached)
|
14
13
|
|
15
14
|
## Setup
|
16
15
|
|
@@ -36,6 +36,15 @@ module RailsSettings
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
# set a setting value by [] notation
|
40
|
+
def []=(var_name, value)
|
41
|
+
super
|
42
|
+
|
43
|
+
Rails.cache.write(cache_key(var_name, @object),value)
|
44
|
+
|
45
|
+
value
|
46
|
+
end
|
47
|
+
|
39
48
|
def save_default(key, value)
|
40
49
|
return false unless self[key].nil?
|
41
50
|
self[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.5.
|
4
|
+
version: 0.5.4
|
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: 2016-
|
14
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|