lib/flipper/middleware/memoizer.rb in flipper-0.11.0 vs lib/flipper/middleware/memoizer.rb in flipper-0.12.0
- old
+ new
@@ -50,26 +50,26 @@
end
def memoized_call(env)
reset_on_body_close = false
flipper = env.fetch(@env_key) { Flipper }
- original = flipper.adapter.memoizing?
- flipper.adapter.memoize = true
+ original = flipper.memoizing?
+ flipper.memoize = true
flipper.preload_all if @opts[:preload_all]
if (preload = @opts[:preload])
flipper.preload(preload)
end
response = @app.call(env)
response[2] = Rack::BodyProxy.new(response[2]) do
- flipper.adapter.memoize = original
+ flipper.memoize = original
end
reset_on_body_close = true
response
ensure
- flipper.adapter.memoize = original if flipper && !reset_on_body_close
+ flipper.memoize = original if flipper && !reset_on_body_close
end
end
end
end