diff options
Diffstat (limited to 'app/models/setting.rb')
-rw-r--r-- | app/models/setting.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb index 12b186fe8..111193cae 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -151,11 +151,16 @@ class Setting < ActiveRecord::Base def self.check_cache settings_updated_on = Setting.maximum(:updated_on) if settings_updated_on && @cached_cleared_on <= settings_updated_on - @cached_settings.clear - @cached_cleared_on = Time.now - logger.info "Settings cache cleared." if logger + clear_cache end end + + # Clears the settings cache + def self.clear_cache + @cached_settings.clear + @cached_cleared_on = Time.now + logger.info "Settings cache cleared." if logger + end private # Returns the Setting instance for the setting named name |