You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When I use advanced memoization techniques in a helper method, it gets flagged by Rails/HelperInstanceVariable.
Describe the solution you'd like
I'd like Rails/HelperInstanceVariable to accept assignment to instance variables for memoization purposes, i.e., it should allow methods like the following:
def foo
return @foo if defined?(@foo)
@foo ||= expensive_calculation_of_foo_that_can_actually_return_nil_value(bar, baz)
end
Describe alternatives you've considered
I considered moving the method elsewhere, but it doesn't make sense for its location to be dependent on using memoization or not.
Is your feature request related to a problem? Please describe.
When I use advanced memoization techniques in a helper method, it gets flagged by Rails/HelperInstanceVariable.
Describe the solution you'd like
I'd like Rails/HelperInstanceVariable to accept assignment to instance variables for memoization purposes, i.e., it should allow methods like the following:
Describe alternatives you've considered
I considered moving the method elsewhere, but it doesn't make sense for its location to be dependent on using memoization or not.
Additional context
Shamelessly extended the following: #311
The text was updated successfully, but these errors were encountered: