summaryrefslogtreecommitdiffstats
path: root/app/models/setting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/setting.rb')
-rw-r--r--app/models/setting.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb
index 111193cae..0b4237537 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -169,6 +169,10 @@ private
name = name.to_s
raise "There's no setting named #{name}" unless @@available_settings.has_key?(name)
setting = find_by_name(name)
- setting ||= new(:name => name, :value => @@available_settings[name]['default']) if @@available_settings.has_key? name
+ unless setting
+ setting = new(:name => name)
+ setting.value = @@available_settings[name]['default']
+ end
+ setting
end
end