summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-19 15:34:06 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-19 15:34:06 +0000
commit59c2530001b49e3acfa36672c2ffc91eba5923c5 (patch)
treea501f6d458b3b79bbdd35832346f73eb64de4fb9
parentcd9412fe52bf5a862b2ee2a704b88ea334950bed (diff)
downloadredmine-59c2530001b49e3acfa36672c2ffc91eba5923c5.tar.gz
redmine-59c2530001b49e3acfa36672c2ffc91eba5923c5.zip
Fixed random failures in RepositoriesControllerTest with ruby-1.8.7-p358.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8909 e93f8b46-1217-0410-a6f0-8f06a7374b81
-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