feature_setting 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e997e0e5c3e97cd8965b4184fbdb9c588c3957a6
|
4
|
+
data.tar.gz: 80c3b200ef96a4a4f0dbb268793d4ab2e575e7da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36221bdde762164bbb4d1cc33d725078666d03faec3429743ed6d6c7d611c43aef7fbc1ce5149a508bc832c517e4b33b232e720046e94bb038e6a52cff97bfa
|
7
|
+
data.tar.gz: 95a2902ff97f5dbda4d4251225c2bcb9b6f93d819b7f87fd9c8b536e8ccd3f788962c1dbba8c83ad535c904522c37bfc4416fb98fb105427faa2de5c04a3714a
|
@@ -48,7 +48,7 @@ module FeatureSetting
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def remove_old_settings!
|
51
|
-
self.where(klass: klass, key:
|
51
|
+
self.where(klass: klass, key: all_stored_keys - defined_keys).destroy_all
|
52
52
|
end
|
53
53
|
|
54
54
|
def reset_settings!
|
@@ -75,13 +75,22 @@ module FeatureSetting
|
|
75
75
|
nil
|
76
76
|
end
|
77
77
|
|
78
|
-
def
|
78
|
+
def defined_keys
|
79
79
|
settings.keys.map(&:to_s)
|
80
80
|
end
|
81
81
|
|
82
|
+
def stored_settings
|
83
|
+
hash = {}
|
84
|
+
self.where(klass: klass).each do |record|
|
85
|
+
hash[record.key.to_sym] = convert_to_type(record.value, record.value_type)
|
86
|
+
end
|
87
|
+
|
88
|
+
hash
|
89
|
+
end
|
90
|
+
|
82
91
|
private
|
83
92
|
|
84
|
-
def
|
93
|
+
def all_stored_keys
|
85
94
|
self.all.pluck(:key)
|
86
95
|
end
|
87
96
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feature_setting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Indro De
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|