Using the activerecord reload command in my application seems to use cached data when called.
I can replicate inside the debugger by doing the following.
u = User.find(1)
u.first_name
u.reload
u.valid?
u.first_name
u = User.find(1)
u.first_name
u = User.where('id = 1').first
u.first_name
When viewing a log file after a reboot, it gives
[1m [35mCACHE (0.0ms) [0m SELECT "users". * FROM "users" WHERE ("users". "Id" = 1) LIMIT 1
So it looks like cache is being used
My environment: Rails 3.0.3, Ruby 1.8.7, Ubuntu 10.04, PostgreSQL 8.4
source
share