Skip to content

Rename strong_memoize_attr to strong_memoize

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The use _attr suffix is confusing since it's we are memoizing a method not an attribute.

So instead

def expensive_method
end
strong_memoize_attr :expensive_method

it's

def expensive_method
end
strong_memoize :expensive_method

and potentially (out of scope)

strong_memoize def expensive_method
end

Tasks

  • Rename method to strong_memoize adding a "grace period" 👇
  • Keep old method and emit a warning to avoid broken master
  • Rename 👮 rule Gitlab/StrongMemoizeAttr to Gitlab/StrongMemoize or Gitlab/StrongMemoizeAnnotation (seperate issue)

Risks

The method name might be confused with the instance method strong_memoize but that should be a problem since we are migrating (see 👮 Gitlab/StrongMemomizeAttr) to class level memoization anyway.

Edited by 🤖 GitLab Bot 🤖