gitlab-org--gitlab-foss/config/initializers/flipper.rb
Rémy Coutable b8a7b59d82 Add the Flipper::Middleware::Memoizer middleware
This ensures we make maximum one call per feature per request.

See
https://github.com/jnunemaker/flipper/blob/v0.10.2/docs/Optimization.md#memoizing-middleware

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-21 17:35:29 +02:00

4 lines
139 B
Ruby

require 'flipper/middleware/memoizer'
Rails.application.config.middleware.use Flipper::Middleware::Memoizer,
lambda { Feature.flipper }