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

Restore ability to pass extra options to cache stores #22800

Merged
merged 1 commit into from
Jan 29, 2016

Conversation

dgynn
Copy link
Contributor

@dgynn dgynn commented Dec 27, 2015

This PR restores the ability to pass options to the cache helper methods which will be passed on the cache store. This functionality worked in 4.x.

The cache helper methods are supposed to pass any extra options to the cache store. For example :expires_in would be a valid option if memcache was the cache store.

<%= cache 'example_of_cached_time', :expires_in => 1.minute do %>
  <p>Some content that will be cached for a minute starting at <%= Time.now %></p>
<% end %>

The change in commit da16745 inadvertently broke the ability to pass any options other than :skip_digest and :virtual_path when some methods were changed to use keyword arguments.

The `cache` helper methods should pass any extra options
to the cache store. For example :expires_in would be a
valid option if memcache was the cache store. The change
in commit da16745 broke the ability to pass any options
other than :skip_digest and :virtual_path. This PR
restores that functionality and adds a test for it.
@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rafaelfranca rafaelfranca added this to the 5.0.0 milestone Dec 30, 2015
@rafaelfranca rafaelfranca merged commit 837e40d into rails:master Jan 29, 2016
rafaelfranca added a commit that referenced this pull request Jan 29, 2016
Restore ability to pass extra options to cache stores
@dgynn dgynn deleted the pr_cache_helper_options branch February 23, 2016 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants