opf/openproject — pull request #490 by mugwump (2013-10-09 12:31:42+00:00)
Title: add a request-store and put the settings_max_updated_on into the request to avoid redundant calls 

The Request-Store is a middleware allows to store thread-local-variables, that are properly cleaned up after the request. This mechanism is then used to store the Setting.maximun(:updated_on) in a thread-local variable, to avoid redundant db-calls/cache-calls.

PS: This only gets rid of the updated-on calls, a longer-term fix would probably be to store accessed setting in a thread-local or even read the whole setting and store it...

PPS: This is largely pulled from https://github.com/steveklabnik/request_store, see the readme for a lengthy discussion about thread-local variables.