flipper-active_record 0.12.0 → 0.12.1

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: 7f229cea6ee1375f4e7646c83b5da628e96bb53f
4
- data.tar.gz: f2e5c18eff0113f078e3b1e8bee95921404d827f
3
+ metadata.gz: f9aab55863101daa2663ee348482f416122a417b
4
+ data.tar.gz: fcc72dadd91ea281545067182a960abff1cef5be
5
5
  SHA512:
6
- metadata.gz: fc26ab0e003c0bf66db5d9733ff7b403edf225a30dd5c1b93577981d471abe5065fe1cf522bcf1eba0a973af3fe1d6c15e9572cc0fd7c56f7349415f5a6df570
7
- data.tar.gz: 1bfa2802ce615c641bde196294d15a726217f09c0ca59f46c3a5d373faa0d3d243fc4d6c6ac89111aaff79ffaabaea084e27b2338a97af67b30efd3e73006fb4
6
+ metadata.gz: 2b6369212ba6dc4eefa299fe73af467b6c458703768261cce31d6f3f53e7d9fc962c48705aebea7992bf1dd55c1b9ec94a86ccf3b1dfaef521608c7d8a809dc7
7
+ data.tar.gz: 7135855356904bfa6982fedac622f058e39ab0e89f7e1bc8983a55c448fd6b7be2fd68a6911c21598a64d022a435ffc8cdcd2c6ef7dc127b485657081240b96d
@@ -89,11 +89,12 @@ module Flipper
89
89
  end
90
90
 
91
91
  def get_all
92
- joins = <<-EOJ
93
- INNER JOIN #{@feature_class.table_name}
94
- ON #{@feature_class.table_name}.key = #{@gate_class.table_name}.feature_key
95
- EOJ
96
- db_gates = @gate_class.joins(joins).all.to_a
92
+ rows = ::ActiveRecord::Base.connection.select_all <<-SQL
93
+ SELECT ff.key AS feature_key, fg.key, fg.value
94
+ FROM #{@feature_class.table_name} ff
95
+ LEFT JOIN #{@gate_class.table_name} fg ON ff.key = fg.feature_key
96
+ SQL
97
+ db_gates = rows.map { |row| Gate.new(row) }
97
98
  grouped_db_gates = db_gates.group_by(&:feature_key)
98
99
  result = Hash.new { |hash, key| hash[key] = default_config }
99
100
  features = grouped_db_gates.keys.map { |key| Flipper::Feature.new(key, self) }
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.12.0'.freeze
2
+ VERSION = '0.12.1'.freeze
3
3
  end
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.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-06 00:00:00.000000000 Z
11
+ date: 2018-01-19 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.12.0
19
+ version: 0.12.1
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.12.0
26
+ version: 0.12.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement