flipper-active_record 0.26.2 → 0.28.3
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/examples/active_record/cached.rb +23 -0
- data/examples/active_record/internals.rb +2 -2
- data/lib/flipper/adapters/active_record.rb +1 -1
- data/lib/flipper/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc8217d866ba4e5e348943be13ebb76c50d7d90ff0ce39c49b1dfd721d2f6da3
|
4
|
+
data.tar.gz: 8ba526732ad0786ccfb682fb3732d4226b5f357466cd52a08dbfa3534c853ade
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8edffe9b5b277baaea8ea0b81bcc2e28b84b09317bf597865344487a5cb36f7a7117759baf31d9e215459775e64af99d778181fb5bd20764d7afb36071587f0c
|
7
|
+
data.tar.gz: 77f3fe7f0bb0873f52e5fe4a80b5e8a5beec83dd3baaa73cbeeb90e24f924dce9dd23f48f3a9406ba394a6d6a6990b11f9daea9103590a8cfb3dc994d44d76b6
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative "./ar_setup"
|
2
|
+
|
3
|
+
# Requires the flipper-active_record gem to be installed.
|
4
|
+
require 'flipper/adapters/active_record'
|
5
|
+
require 'flipper/adapters/active_support_cache_store'
|
6
|
+
|
7
|
+
Flipper.configure do |config|
|
8
|
+
config.adapter do
|
9
|
+
Flipper::Adapters::ActiveSupportCacheStore.new(
|
10
|
+
Flipper::Adapters::ActiveRecord.new,
|
11
|
+
ActiveSupport::Cache::MemoryStore.new,
|
12
|
+
expires_in: 2.seconds
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
18
|
+
|
19
|
+
puts "You should see 5 or 6 queries."
|
20
|
+
10.times do |i|
|
21
|
+
Flipper.enabled?(:foo)
|
22
|
+
sleep 1
|
23
|
+
end
|
@@ -4,8 +4,8 @@ require_relative "./ar_setup"
|
|
4
4
|
require 'flipper/adapters/active_record'
|
5
5
|
|
6
6
|
# Register a few groups.
|
7
|
-
Flipper.register(:admins) { |
|
8
|
-
Flipper.register(:early_access) { |
|
7
|
+
Flipper.register(:admins) { |actor| actor.admin? }
|
8
|
+
Flipper.register(:early_access) { |actor| actor.early_access? }
|
9
9
|
|
10
10
|
# Create a user class that has flipper_id instance method.
|
11
11
|
User = Struct.new(:flipper_id)
|
@@ -146,7 +146,7 @@ module Flipper
|
|
146
146
|
# Public: Enables a gate for a given thing.
|
147
147
|
#
|
148
148
|
# feature - The Flipper::Feature for the gate.
|
149
|
-
# gate - The Flipper::Gate to
|
149
|
+
# gate - The Flipper::Gate to enable.
|
150
150
|
# thing - The Flipper::Type being enabled for the gate.
|
151
151
|
#
|
152
152
|
# Returns true.
|
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.28.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-21 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.
|
19
|
+
version: 0.28.3
|
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.28.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- benchmark/active_record_setup.rb
|
57
57
|
- examples/active_record/ar_setup.rb
|
58
58
|
- examples/active_record/basic.rb
|
59
|
+
- examples/active_record/cached.rb
|
59
60
|
- examples/active_record/internals.rb
|
60
61
|
- flipper-active_record.gemspec
|
61
62
|
- lib/flipper-active_record.rb
|