Explorar el Código

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 hace 11 años
padre
commit
a29854707b
Se han modificado 2 ficheros con 9 adiciones y 1 borrados
  1. 6
    1
      app/models/user.rb
  2. 3
    0
      test/unit/user_test.rb

+ 6
- 1
app/models/user.rb Ver fichero

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

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

Cargando…
Cancelar
Guardar