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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2bf01c33aad4266b0237775c779d6b3b19d01d43adff566c82c1ddb26fb76f5
4
- data.tar.gz: 34ba1e6bded36a3352031c82b9f32d34abbb5f8781eb28b15f7aa450cbd02cbd
3
+ metadata.gz: fc8217d866ba4e5e348943be13ebb76c50d7d90ff0ce39c49b1dfd721d2f6da3
4
+ data.tar.gz: 8ba526732ad0786ccfb682fb3732d4226b5f357466cd52a08dbfa3534c853ade
5
5
  SHA512:
6
- metadata.gz: 303520e21a9e3f71284d72bb817032df8849b5bee213e4a42924ab5e90af1f38e82734830fba40d11c0b6e91962b134838e80d181f4c7482f306f64651222bf6
7
- data.tar.gz: f9b371acc123a5a7cc8e901d40db474a83f706d886496512b9f24c298d0a8e621c2e394b3b38f8bddc5b92966d7ab594f38c1b83912026eac967133dccd1eb2d
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) { |thing| thing.admin? }
8
- Flipper.register(:early_access) { |thing| thing.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 disable.
149
+ # gate - The Flipper::Gate to enable.
150
150
  # thing - The Flipper::Type being enabled for the gate.
151
151
  #
152
152
  # Returns true.
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.26.2'.freeze
2
+ VERSION = '0.28.3'.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.26.2
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-03-15 00:00:00.000000000 Z
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.26.2
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.2
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