clear cache before firing the settings callback

Otherwise, callback listeners working on the change can not get the current value
pull/4801/head
Jens Ulferts 8 years ago
parent 39cff0c822
commit 3ee5c4edb6
  1. 6
      app/models/setting.rb

@ -157,12 +157,12 @@ class Setting < ActiveRecord::Base
if new_setting.save
new_value = new_setting.value
# fire callbacks for name and pass as much information as possible
fire_callbacks(name, new_value, old_setting)
# Delete the cache
clear_cache(old_cache_key)
# fire callbacks for name and pass as much information as possible
fire_callbacks(name, new_value, old_setting)
new_value
else
old_setting

Loading…
Cancel
Save