summaryrefslogtreecommitdiffstats
path: root/app/models/setting.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-01-25 10:31:06 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-01-25 10:31:06 +0000
commit79f92a675af528ecbe5abcc15b9c98805c9c7315 (patch)
treec5c2f04a5b16bfc2d98fe03495bc83f902188ee0 /app/models/setting.rb
parent3d5d1a38e3d48e1fda7eee751563cbf8c3b0f00b (diff)
downloadredmine-79f92a675af528ecbe5abcc15b9c98805c9c7315.tar.gz
redmine-79f92a675af528ecbe5abcc15b9c98805c9c7315.zip
User display format is now configurable in administration settings.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1103 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/setting.rb')
-rw-r--r--app/models/setting.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb
index 46b6d76ce..185991d9b 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -53,12 +53,13 @@ class Setting < ActiveRecord::Base
v = read_attribute(:value)
# Unserialize serialized settings
v = YAML::load(v) if @@available_settings[name]['serialized'] && v.is_a?(String)
+ v = v.to_sym if @@available_settings[name]['format'] == 'symbol' && !v.blank?
v
end
def value=(v)
v = v.to_yaml if v && @@available_settings[name]['serialized']
- write_attribute(:value, v)
+ write_attribute(:value, v.to_s)
end
# Returns the value of the setting named name