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: ab8e41a32042cf67cc57b481b65f0b91b3b40120
4
- data.tar.gz: 43fe930139c71bf372959fab6a9dff0e87f01ead
3
+ metadata.gz: e997e0e5c3e97cd8965b4184fbdb9c588c3957a6
4
+ data.tar.gz: 80c3b200ef96a4a4f0dbb268793d4ab2e575e7da
5
5
  SHA512:
6
- metadata.gz: 6b8a06dc361a89c9f21e5b5903b8bf9975138c7e98c5301ccadba9c5d6048b53e2bf41cb53132212f9cf2f3856c9fc1e01031c3813bb15b7c6c6740b39a50c88
7
- data.tar.gz: 507ebb28119c420308cdfdc562ca0805510335c2c6b148d63d78741f11f54238d320002af36b66c096d602bae95d6841e1a498882142c4691496876e0af84eaa
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: all_stored_settings - defined_settings).destroy_all
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 defined_settings
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 all_stored_settings
93
+ def all_stored_keys
85
94
  self.all.pluck(:key)
86
95
  end
87
96
 
@@ -1,3 +1,3 @@
1
1
  module FeatureSetting
2
- VERSION = "1.5.2"
2
+ VERSION = "1.5.3"
3
3
  end
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.2
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-10 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport