diff --git a/app/models/configuration.rb b/app/models/configuration.rb --- a/app/models/configuration.rb +++ b/app/models/configuration.rb @@ -18,6 +18,10 @@ Configuration.config_cache = nil Configuration.task_grading_info_cache = nil + def self.config_cached? + (defined? CONFIGURATION_CACHE_ENABLED) and (CONFIGURATION_CACHE_ENABLED) + end + def self.get(key) if Configuration.config_cached? if Configuration.config_cache == nil @@ -132,10 +136,6 @@ protected - def self.config_cached? - (defined? CONFIGURATION_CACHE_ENABLED) and (CONFIGURATION_CACHE_ENABLED) - end - def self.convert_type(val,type) case type when 'string' diff --git a/app/views/configurations/index.html.haml b/app/views/configurations/index.html.haml --- a/app/views/configurations/index.html.haml +++ b/app/views/configurations/index.html.haml @@ -20,7 +20,7 @@ = in_place_editor_field :configuration, :value, {}, :rows=>1 %td= conf.description -- if Configuration.cache? +- if Configuration.config_cached? %br/ Your config is saved, but it does not automatically take effect. %br/