summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-01 07:08:04 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-01 07:08:04 +0000
commita29854707b30d74f43b448f288c7663cbd6066d3 (patch)
tree9d76a8ad896acd400e50159a30031f385ffa0f1f
parentde0e0f09a33b20170468d9fdc67c4b5b7ac085d2 (diff)
downloadredmine-a29854707b30d74f43b448f288c7663cbd6066d3.tar.gz
redmine-a29854707b30d74f43b448f288c7663cbd6066d3.zip
add new user format "lastname" (#10937)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10543 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/user.rb7
-rw-r--r--test/unit/user_test.rb3
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index bd1488fa0..0b48263f4 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -48,10 +48,15 @@ class User < Principal
:order => %w(lastname firstname id),
:setting_order => 4
},
+ :lastname => {
+ :string => '#{lastname}',
+ :order => %w(lastname id),
+ :setting_order => 5
+ },
:username => {
:string => '#{login}',
:order => %w(login id),
- :setting_order => 5
+ :setting_order => 6
},
}
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index 1f4d89657..20056406b 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -417,6 +417,9 @@ class UserTest < ActiveSupport::TestCase
with_settings :user_format => :username do
assert_equal 'jsmith', @jsmith.reload.name
end
+ with_settings :user_format => :lastname do
+ assert_equal 'Smith', @jsmith.reload.name
+ end
end
def test_today_should_return_the_day_according_to_user_time_zone