This project is archived and is in readonly mode.
Memoizable doesn't memoize overriden methods
-
CancelProfileIsBroken
- Tag set to bugmash
-
Elomar França
- Tag changed from bugmash to activesupport, bugmash, memoizable
+1, verified.
In this case, memoization would only work if Bar#foo called super.
I've attached a patch with a failing test, applies on 2-3-stable and master.
-
John Pignata
- Tag changed from activesupport, bugmash, memoizable to activesupport, bugmash, memoizable, patch
I've tried several approaches to allow this, notably functionality such as tracking memoized methods using an instance hash and method_added trickery to figure out when a method was overridden. Nothing appears to work across all cases well.
My attached patch for master adds an option hash to memoize. If :force => true is passed in this hash, memoize will not raise an error. This will allow a developer who encounters this edge case to work around it.
-
Rizwan Reza
- Tag changed from activesupport, bugmash, memoizable, patch to activesupport, memoizable, patch
-
Santiago Pastorino
- State changed from new to open
- Importance changed from to
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
