Commit b8a7b59d authored by Rémy Coutable's avatar Rémy Coutable

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-middlewareSigned-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 0551364c
require 'flipper/middleware/memoizer'
Rails.application.config.middleware.use Flipper::Middleware::Memoizer,
lambda { Feature.flipper }
...@@ -39,7 +39,6 @@ class Feature ...@@ -39,7 +39,6 @@ class Feature
get(key).disable get(key).disable
end end
private
def flipper def flipper
@flipper ||= begin @flipper ||= begin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment