Skip to content

Stop passing member name to `strong_memoize_attr`

Peter Leitzen requested to merge pl-strong-memoize-attr-member-name into master

What does this MR do and why?

This MR removes the second parameter (member name) of strong_memoize_attr. This name is now inferred from the method name. Invalid special chars (only ! and ?) are replaced with allowed Unicode counterparts:

# Example:
  @key? # becomes
  @key

  @key! # becomes
  @key

Other chars are ignored because they are also not allowed as method names.

This MR also removes the second argument from strong_memoize_attr from various locations.

Contributes to #382399 (closed).

How to set up and validate locally

$ bin/rails console

> Rails.application.eager_load!

# No errors.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports