diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-11-26 11:32:40 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-11-26 11:32:40 +0000 |
commit | 777f5e78c4ebe193efd631189bb2c09f1bac2df0 (patch) | |
tree | b34b184868a28ed10b601a658824c735bae1c9a2 /app/helpers/application_helper.rb | |
parent | 64618741c17760fcb59647d74d1ccaff56160b15 (diff) | |
parent | d29ab6b1ef7b005b3dbd2e0f1c295e2022794267 (diff) |
Merge branch 'feature/restore-caching' into wdtk
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e3b1e57ac..0c346ab4e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -116,5 +116,12 @@ module ApplicationHelper return !session[:using_admin].nil? || (!@user.nil? && @user.super?) end + def cache_if_caching_fragments(*args, &block) + if AlaveteliConfiguration::cache_fragments + cache(*args) { yield } + else + yield + end + end end |