flipper-sequel 0.21.0 → 0.22.0

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: aa83337636b5039464206b454335756a1065343c1ae8d7fe8083b4d27dcf604e
4
- data.tar.gz: 32af671861afdf85d3a6c800fa38e6223cef9fa67fc837db1b19a03b1d206857
3
+ metadata.gz: 5ed17230bf73572a1eb0d6e9d517e0a01a459f73a50ec0058f6977ad92c1e78a
4
+ data.tar.gz: 0d372c287dbc20dc98558544165bc1b96c9cc553ace717be21157d991372a005
5
5
  SHA512:
6
- metadata.gz: a613b22e95c6c5478837cece0f58508d5e92b51e3b9902a873146b17813ffbd3fdd9dccd89ec8bd4bd8fe0b36a3e4743c9947b28244c54d3c549d4f620f7ef88
7
- data.tar.gz: 5d5eef8a95a52645e07ef5d10c201dc32d9551941168f53df10ff7c847a5c6b327f3739ab6c1eee8ee98dd56cbe994232711775feb99693b3e405313835a4d10
6
+ metadata.gz: 4d4eb797141a7130d78f74b6b6daa2958f5216205f94da3660e65ae4c6d51aa20f6cbbcf46b65f20aa4c7349a9cf59938423ce1b116a4c24b17c8e43a768cdd9
7
+ data.tar.gz: a94221243cdbf03ccf2f6d4bf3ec550921e6f15e06700005972f392ae25ff466876ecb5f9b079b9941bea70d64a1d53a5d22073f6a5be7118327ac12027ba08d
@@ -97,11 +97,15 @@ module Flipper
97
97
  end
98
98
 
99
99
  def get_all
100
- db_gates = @gate_class.fetch(<<-SQL).to_a
101
- SELECT ff.key AS feature_key, fg.key, fg.value
102
- FROM #{@feature_class.table_name} ff
103
- LEFT JOIN #{@gate_class.table_name} fg ON ff.key = fg.feature_key
104
- SQL
100
+ feature_table = @feature_class.table_name.to_sym
101
+ gate_table = @gate_class.table_name.to_sym
102
+ features_sql = @feature_class.select(:key.qualify(feature_table).as(:feature_key))
103
+ .select_append(:key.qualify(gate_table))
104
+ .select_append(:value.qualify(gate_table))
105
+ .left_join(@gate_class.table_name.to_sym, feature_key: :key)
106
+ .sql
107
+
108
+ db_gates = @gate_class.fetch(features_sql).to_a
105
109
  grouped_db_gates = db_gates.group_by(&:feature_key)
106
110
  result = Hash.new { |hash, key| hash[key] = default_config }
107
111
  features = grouped_db_gates.keys.map { |key| Flipper::Feature.new(key, self) }
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.21.0'.freeze
2
+ VERSION = '0.22.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipper-sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
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-05-09 00:00:00.000000000 Z
11
+ date: 2021-07-08 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.21.0
19
+ version: 0.22.0
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.21.0
26
+ version: 0.22.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sequel
29
29
  requirement: !ruby/object:Gem::Requirement