Only using request-level cache if the helper has a request #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Firstly, thanks for building such a great gem. The interface is quite intuitive and the source code is very clear. It's really been useful for our team in adding A/B tests (and sometimes feature toggling). We've introduced many improvements based on the results in the last few months. 馃檹
This is my first open source pull request so please let me know if I'm 'doing it wrong' 馃槃
We had an issue where we were using FieldTest::Helpers in a service with class methods.
Unfortunately, this meant that our app cached the result in @field_test_cache per experiment permanently (until the app restarts anyway). Looking at the comments inside FieldTest::Helpers#field_test, it seems to be setting the cache for the request outside of the check for the request. This fix means that it will only be using the cache when a request is present.
I also added a tweak to the assignment of params_variant because it could be unassigned. Happy to roll it back if you don't like doing it that way.