From f2d0f6714c0b180ed00ac846ec75a4aef3dd00c2 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Thu, 14 May 2009 19:56:21 -0300 Subject: [PATCH] ActionItem1049: cache terminology --- app/controllers/application.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index dd00034..ae6f780 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -103,7 +103,10 @@ class ApplicationController < ActionController::Base end def load_terminology - Noosfero.terminology = environment.terminology + # cache terminology for performance + @terminology_cache ||= {} + @terminology_cache[environment.id] ||= environment.terminology + Noosfero.terminology = @terminology_cache[environment.id] end def render_not_found(path = nil) -- libgit2 0.21.2