diff options
author | Paul Charlton <techguru@byiq.com> | 2017-06-06 19:48:10 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-06 19:48:10 +0300 |
commit | d93352825ae1b738d1d1922f26308166447b041d (patch) | |
tree | 9665997e9171c010823fcdfaa0b50559635197e1 /app/models/application_setting.rb | |
parent | 86b4cd618d76f1a0dd8a7f8b777718b3e9d308d0 (diff) |
redesign caching of application settings
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 3b49cb4e3bf..2192f76499d 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -189,8 +189,9 @@ class ApplicationSetting < ActiveRecord::Base end def self.cached - ensure_cache_setup - Rails.cache.fetch(CACHE_KEY) + value = Rails.cache.read(CACHE_KEY) + ensure_cache_setup if value.present? + value end def self.ensure_cache_setup |