Commit f2d0f6714c0b180ed00ac846ec75a4aef3dd00c2

Authored by Antonio Terceiro
1 parent 04fac3a0

ActionItem1049: cache terminology

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
app/controllers/application.rb
@@ -103,7 +103,10 @@ class ApplicationController < ActionController::Base @@ -103,7 +103,10 @@ class ApplicationController < ActionController::Base
103 end 103 end
104 104
105 def load_terminology 105 def load_terminology
106 - Noosfero.terminology = environment.terminology 106 + # cache terminology for performance
  107 + @terminology_cache ||= {}
  108 + @terminology_cache[environment.id] ||= environment.terminology
  109 + Noosfero.terminology = @terminology_cache[environment.id]
107 end 110 end
108 111
109 def render_not_found(path = nil) 112 def render_not_found(path = nil)