flipper-active_record 0.21.0.rc2 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/flipper-active_record.gemspec +1 -1
- data/lib/flipper/adapters/active_record.rb +15 -9
- data/lib/flipper/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 912bdcd897f28bba90d89b435bb107e5b120291d1a5640f52281c95b642e7219
|
4
|
+
data.tar.gz: 9a82dad8ea4bf325bf4c81406090653ce1930a1c1cd9901351c67d9c255be60e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a974e2666d2afb8bea885b775004ba84ea84d947a6b47b68136171442c4d4daf623979d816eeafb7844008d6c2df71daa16cf42b6b7d3be4979802055a2527
|
7
|
+
data.tar.gz: 3d06634017bd951b9ec1cd9ac5e5f3186d31c85391fca1f4119fbf651a182ad1d61eb2d66f86709ba091c657f18b65399004c20f36edc1361676763881a7837c
|
@@ -101,11 +101,12 @@ module Flipper
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def get_all
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
104
|
+
features = ::Arel::Table.new(@feature_class.table_name.to_sym)
|
105
|
+
gates = ::Arel::Table.new(@gate_class.table_name.to_sym)
|
106
|
+
rows_query = features.join(gates, Arel::Nodes::OuterJoin)
|
107
|
+
.on(features[:key].eq(gates[:feature_key]))
|
108
|
+
.project(features[:key].as('feature_key'), gates[:key], gates[:value])
|
109
|
+
rows = ::ActiveRecord::Base.connection.select_all rows_query
|
109
110
|
db_gates = rows.map { |row| Gate.new(row) }
|
110
111
|
grouped_db_gates = db_gates.group_by(&:feature_key)
|
111
112
|
result = Hash.new { |hash, key| hash[key] = default_config }
|
@@ -172,10 +173,15 @@ module Flipper
|
|
172
173
|
@gate_class.transaction do
|
173
174
|
clear(feature) if clear_feature
|
174
175
|
@gate_class.where(feature_key: feature.key, key: gate.key).destroy_all
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
176
|
+
begin
|
177
|
+
@gate_class.create! do |g|
|
178
|
+
g.feature_key = feature.key
|
179
|
+
g.key = gate.key
|
180
|
+
g.value = thing.value.to_s
|
181
|
+
end
|
182
|
+
rescue ::ActiveRecord::RecordNotUnique
|
183
|
+
# assume this happened concurrently with the same thing and its fine
|
184
|
+
# see https://github.com/jnunemaker/flipper/issues/544
|
179
185
|
end
|
180
186
|
end
|
181
187
|
|
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.
|
4
|
+
version: 0.22.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: 2021-
|
11
|
+
date: 2021-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flipper
|
@@ -16,21 +16,21 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.22.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.
|
26
|
+
version: 0.22.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '4.2'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '7'
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
43
|
+
version: '4.2'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '7'
|
@@ -80,9 +80,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- - "
|
83
|
+
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
85
|
+
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubygems_version: 3.0.3
|
88
88
|
signing_key:
|