You are right, ActiveRecord does cache results, but not always. Like when you use scopes or self methods or finder methods etc. In most real-world use cases, you wouldn't do a User.all anyway. I'll try to update to a better example sometime later, but the gist was to suggest how to memoize dynamic methods. :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You are right, ActiveRecord does cache results, but not always. Like when you use scopes or self methods or finder methods etc. In most real-world use cases, you wouldn't do a
User.all
anyway. I'll try to update to a better example sometime later, but the gist was to suggest how to memoize dynamic methods. :)