flipper-active_record 0.17.1 → 0.17.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d3bd79fbfb00866cf27a49c6536f83e294e84199433a297bde832f87d4e6792
|
4
|
+
data.tar.gz: cdef915d7638974a6f5a528394e0917fcd5d47a43902320688bfff61d33fd251
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e28f948df8c2ba80a1bb35fa302369d6ef945a8dec6a631b27c68151b65c2fb339999a6777acd9eb024771ca3f953e1dd28bc7098c59deb6e330110ae11d8084
|
7
|
+
data.tar.gz: b50696f59dc7b509a44ffd5a0daa37bdcaba56e19c95ef06a0fc36e45de112b6d2c4ac4da0c5d75bd34e80d1f913862f41b960499e910671ec53171f7fe83a9a
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
'lib/flipper/version.rb',
|
20
20
|
]
|
21
21
|
gem.files = `git ls-files`.split("\n").select(&flipper_active_record_files) + extra_files
|
22
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_active_record_files) # rubocop:disable
|
22
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").select(&flipper_active_record_files) # rubocop:disable Layout/LineLength
|
23
23
|
gem.name = 'flipper-active_record'
|
24
24
|
gem.require_paths = ['lib']
|
25
25
|
gem.version = Flipper::VERSION
|
@@ -59,7 +59,7 @@ module Flipper
|
|
59
59
|
unless @feature_class.where(key: feature.key).first
|
60
60
|
begin
|
61
61
|
@feature_class.create! { |f| f.key = feature.key }
|
62
|
-
rescue ActiveRecord::RecordNotUnique
|
62
|
+
rescue ::ActiveRecord::RecordNotUnique
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
@@ -125,7 +125,9 @@ module Flipper
|
|
125
125
|
# Returns true.
|
126
126
|
def enable(feature, gate, thing)
|
127
127
|
case gate.data_type
|
128
|
-
when :boolean
|
128
|
+
when :boolean
|
129
|
+
set(feature, gate, thing, clear: true)
|
130
|
+
when :integer
|
129
131
|
set(feature, gate, thing)
|
130
132
|
when :set
|
131
133
|
enable_multi(feature, gate, thing)
|
@@ -165,8 +167,10 @@ module Flipper
|
|
165
167
|
|
166
168
|
private
|
167
169
|
|
168
|
-
def set(feature, gate, thing)
|
170
|
+
def set(feature, gate, thing, options = {})
|
171
|
+
clear_feature = options.fetch(:clear, false)
|
169
172
|
@gate_class.transaction do
|
173
|
+
clear(feature) if clear_feature
|
170
174
|
@gate_class.where(feature_key: feature.key, key: gate.key).destroy_all
|
171
175
|
@gate_class.create! do |g|
|
172
176
|
g.feature_key = feature.key
|
data/lib/flipper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flipper
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.17.
|
19
|
+
version: 0.17.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.17.
|
26
|
+
version: 0.17.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- lib/flipper/version.rb
|
62
62
|
- lib/generators/flipper/active_record_generator.rb
|
63
63
|
- lib/generators/flipper/templates/migration.erb
|
64
|
+
- spec/flipper/adapters/active_record_requires_spec.rb
|
64
65
|
- spec/flipper/adapters/active_record_spec.rb
|
65
66
|
- test/adapters/active_record_test.rb
|
66
67
|
- test_rails/generators/flipper/active_record_generator_test.rb
|
@@ -89,5 +90,6 @@ signing_key:
|
|
89
90
|
specification_version: 4
|
90
91
|
summary: ActiveRecord adapter for Flipper
|
91
92
|
test_files:
|
93
|
+
- spec/flipper/adapters/active_record_requires_spec.rb
|
92
94
|
- spec/flipper/adapters/active_record_spec.rb
|
93
95
|
- test/adapters/active_record_test.rb
|