Permalink
Browse files

applies patch in http://rails.lighthouseapp.com/projects/8994/tickets…

  • Loading branch information...
1 parent 408d5fd commit acf520457462d3987adbf540625c59e355e4d974 @fxn fxn committed May 7, 2008
Showing with 6 additions and 0 deletions.
  1. +6 −0 activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
@@ -44,6 +44,12 @@ def uncached
@query_cache_enabled = old
end
+ # Clears the query cache.
+ #
+ # One reason you may wish to call this method explicitly is between queries
+ # that ask the database to randomize results. Otherwise the cache would see
+ # the same SQL query and repeatedly return the same result each time, silently
+ # undermining the randomness you were expecting.
def clear_query_cache
@query_cache.clear if @query_cache
end

0 comments on commit acf5204

Please sign in to comment.