2017-12-13 19:26:07 -05:00
|
|
|
require 'flipper/adapters/active_record'
|
|
|
|
require 'flipper/adapters/active_support_cache_store'
|
2017-06-21 10:35:14 -04:00
|
|
|
|
2017-12-13 19:26:07 -05:00
|
|
|
Flipper.configure do |config|
|
|
|
|
config.default do
|
|
|
|
adapter = Flipper::Adapters::ActiveRecord.new(
|
|
|
|
feature_class: Feature::FlipperFeature, gate_class: Feature::FlipperGate)
|
|
|
|
cached_adapter = Flipper::Adapters::ActiveSupportCacheStore.new(
|
|
|
|
adapter,
|
|
|
|
Rails.cache,
|
|
|
|
expires_in: 10.seconds)
|
|
|
|
|
|
|
|
Flipper.new(cached_adapter)
|
|
|
|
end
|
|
|
|
end
|
2017-07-10 09:54:49 -04:00
|
|
|
|
2017-12-13 19:26:07 -05:00
|
|
|
Feature.register_feature_groups
|
|
|
|
|
|
|
|
unless Rails.env.test?
|
|
|
|
require 'flipper/middleware/memoizer'
|
|
|
|
Rails.application.config.middleware.use Flipper::Middleware::Memoizer
|
2017-07-05 10:42:17 -04:00
|
|
|
end
|