0

On a couple of my projects running Rails 3 + Postgres, my sites have displayed stale data in places. It's as if it's being cached somewhere even though I am not doing any explicit caching of the page/action/fragment/data. Restarting the app cures the problem and the most up-to-date information is displayed. It appears to happen after a while of the server being up. Has any one encountered the same problem or now of what I should try to remedy the information. It's particularly annoying as emails triggered by our rake tasks show different values to that shown on the site itself.

Solved: Discovered this was a bug related to not wrapping the Times and Dates inside of a lambda when used as part of a scope.

Hates_
  • 66,613
  • 6
  • 32
  • 37
  • Are you potentially caching things in your classes? Posting some related model code would definitely be useful. – Peter Brown Aug 18 '11 at 01:08
  • In one case it's a count and in another it's an enumeration. Both cases it's just a find using scopes performed in the controller. I've written no code that attempts to cache the results. – Hates_ Aug 18 '11 at 08:37

1 Answers1

1

I had the same problem with Rails 3.2.4. The problem was fixed when I upgraded to 3.2.7. I tracked this down after reading: Rails 3.2.4 SQL query is caching results on find(:all)

Community
  • 1
  • 1
John Wallace
  • 161
  • 1
  • 2