summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-06-04 22:44:59 -0600
committermo khan <mo@mokhan.ca>2013-06-04 22:44:59 -0600
commit5b3ad16ce5928ee7be7536f68795ffc3dce51f4f (patch)
tree5b89b41ce36e57332c80369e0d359e9ff3ff2a52 /app/controllers/application_controller.rb
parent5c5c2321351fa62dfbe8843cfb9e3020a95d043e (diff)
cache the categories
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 762a041e..43451355 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -14,6 +14,8 @@ class ApplicationController < ActionController::Base
end
def load_categories
- @categories = Category.all
+ @categories = Rails.cache.fetch("categories") do
+ Category.all
+ end
end
end