Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache! force option ignored? #424

Open
bobdutch opened this issue Jan 25, 2018 · 1 comment · May be fixed by #425
Open

cache! force option ignored? #424

bobdutch opened this issue Jan 25, 2018 · 1 comment · May be fixed by #425

Comments

@bobdutch
Copy link

bobdutch commented Jan 25, 2018

In versions 2.5.0 and older you could do

json.cache! "key_name", expires_in: 10.minutes, force: force? do
where force? is a method that returns a boolean. If force was true then rails would generate and write the cache. This is broken when I upgrade to 2.6 and greater.

I tried using cache_if! as a workaround but it doesn't expire the cache. Is this a bug or an intentional change?

@bobdutch
Copy link
Author

bobdutch commented Jan 25, 2018

Here is the merge that broke it 65dfb33
It went from using cache.fetch (which takes the force option) to using cache.read and cache.write

@bobdutch bobdutch linked a pull request Jan 26, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants