Sha256: c6b85079bd32ac3bec05c30f54205ea877646feefb8a66ce298b544a0a8db71a

Contents?: true

Size: 561 Bytes

Versions: 18

Compression:

Stored size: 561 Bytes

Contents

require_relative "./ar_setup"

# Requires the flipper-active_record gem to be installed.
require 'flipper/adapters/active_record'
require 'flipper/adapters/active_support_cache_store'

Flipper.configure do |config|
  config.adapter do
    Flipper::Adapters::ActiveSupportCacheStore.new(
      Flipper::Adapters::ActiveRecord.new,
      ActiveSupport::Cache::MemoryStore.new,
      expires_in: 2.seconds
    )
  end
end

ActiveRecord::Base.logger = Logger.new(STDOUT)

puts "You should see 5 or 6 queries."
10.times do |i|
  Flipper.enabled?(:foo)
  sleep 1
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
flipper-active_record-1.3.2 examples/active_record/cached.rb
flipper-active_record-1.3.1 examples/active_record/cached.rb
flipper-active_record-1.3.0 examples/active_record/cached.rb
flipper-active_record-1.3.0.pre examples/active_record/cached.rb
flipper-active_record-1.2.2 examples/active_record/cached.rb
flipper-active_record-1.2.1 examples/active_record/cached.rb
flipper-active_record-1.2.0 examples/active_record/cached.rb
flipper-active_record-1.1.2 examples/active_record/cached.rb
flipper-active_record-1.1.1 examples/active_record/cached.rb
flipper-active_record-1.1.0 examples/active_record/cached.rb
flipper-active_record-1.0.0 examples/active_record/cached.rb
flipper-active_record-1.0.0.pre examples/active_record/cached.rb
flipper-active_record-0.28.3 examples/active_record/cached.rb
flipper-active_record-0.28.2 examples/active_record/cached.rb
flipper-active_record-0.28.1 examples/active_record/cached.rb
flipper-active_record-0.28.0 examples/active_record/cached.rb
flipper-active_record-0.27.1 examples/active_record/cached.rb
flipper-active_record-0.27.0 examples/active_record/cached.rb