Browse Source

add new user format "lastname" (#10937)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10543 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/2.2.0
Toshi MARUYAMA 11 years ago
parent
commit
a29854707b
2 changed files with 9 additions and 1 deletions
  1. 6
    1
      app/models/user.rb
  2. 3
    0
      test/unit/user_test.rb

+ 6
- 1
app/models/user.rb View File

@@ -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
},
}


+ 3
- 0
test/unit/user_test.rb View File

@@ -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

Loading…
Cancel
Save