diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-12-20 11:54:23 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-12-20 11:54:23 +0000 |
commit | 3e4d4a0c1af00542dd9f794c452df6614fc7e840 (patch) | |
tree | f2198f8ce923557970e91fe45d7d4f2b234c4427 /app/models/setting.rb | |
parent | 9b5ce4b7b44beadc00c80f1e8ab24b6e487a462b (diff) | |
download | redmine-3e4d4a0c1af00542dd9f794c452df6614fc7e840.tar.gz redmine-3e4d4a0c1af00542dd9f794c452df6614fc7e840.zip |
Rails4 compatibility of Setting model
git-svn-id: http://svn.redmine.org/redmine/trunk@12423 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/setting.rb')
-rw-r--r-- | app/models/setting.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb index b7a2a9b32..baef55815 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -242,9 +242,10 @@ private def self.find_or_default(name) name = name.to_s raise "There's no setting named #{name}" unless @@available_settings.has_key?(name) - setting = find_by_name(name) + setting = where(:name => name).first unless setting - setting = new(:name => name) + setting = new + setting.name = name setting.value = @@available_settings[name]['default'] end setting |