summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 15:03:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-05 15:03:29 +0000
commit5324fd04b19d1e894507e9f07d7424fcd808ee0a (patch)
tree59d02ecb04d10cea8153fdcb2844437ae9b107d4 /app
parent3b6ba58b112e6d4026f17a43d8dd17a469d48ec8 (diff)
downloadredmine-5324fd04b19d1e894507e9f07d7424fcd808ee0a.tar.gz
redmine-5324fd04b19d1e894507e9f07d7424fcd808ee0a.zip
Specify the order for finding a setting.
git-svn-id: http://svn.redmine.org/redmine/trunk@13721 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/setting.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/setting.rb b/app/models/setting.rb
index a16eede4e..a5e64a285 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -243,7 +243,7 @@ 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 = where(:name => name).first
+ setting = where(:name => name).order(:id => :desc).first
unless setting
setting = new
setting.name = name