]> source.dussan.org Git - redmine.git/commitdiff
Merged r8909 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 19 Feb 2012 15:41:24 +0000 (15:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 19 Feb 2012 15:41:24 +0000 (15:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.3-stable@8910 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/setting.rb

index 111193caeaee09f19e6b2db5b02de3bf357766a4..0b423753785ade3a12761b8620a44903dc8b9c1c 100644 (file)
@@ -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