Skip to content

Replace deprecated around_filter with around_action in README - #631

Open
jimmyasyraf wants to merge 1 commit into
Shopify:mainfrom
jimmyasyraf:fix/readme-memo-around-action
Open

Replace deprecated around_filter with around_action in README#631
jimmyasyraf wants to merge 1 commit into
Shopify:mainfrom
jimmyasyraf:fix/readme-memo-around-action

Conversation

@jimmyasyraf

Copy link
Copy Markdown

Documentation-only change: updates the memoized cache proxy example in the README to use around_action instead of around_filter.

Why

The *_filter callback names were deprecated in Rails 5.0 and removed entirely in Rails 5.1 (2017). Copying the current README example into any modern Rails app raises:

NoMethodError: undefined method 'around_filter' for ApplicationController

around_action is the direct replacement (it was introduced as an alias in Rails 4.0 and has been the canonical name since), so the example now works on all Rails versions this gem supports.

class ApplicationController < ActionController::Base
  around_action :identity_cache_memoization

  def identity_cache_memoization(&block)
    IdentityCache.cache.with_memoization(&block)
  end
end

No behavior change — with_memoization itself is untouched.

@jimmyasyraf

Copy link
Copy Markdown
Author

I have signed the CLA!

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.

1 participant