@@ -0,0 +1,5 | |||
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
|
2 | <loadpath> | |
|
3 | <pathentry path="" type="src"/> | |
|
4 | <pathentry path="org.rubypeople.rdt.launching.RUBY_CONTAINER" type="con"/> | |
|
5 | </loadpath> |
@@ -0,0 +1,18 | |||
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
|
2 | <projectDescription> | |
|
3 | <name>trunk_fixes</name> | |
|
4 | <comment></comment> | |
|
5 | <projects> | |
|
6 | </projects> | |
|
7 | <buildSpec> | |
|
8 | <buildCommand> | |
|
9 | <name>org.rubypeople.rdt.core.rubybuilder</name> | |
|
10 | <arguments> | |
|
11 | </arguments> | |
|
12 | </buildCommand> | |
|
13 | </buildSpec> | |
|
14 | <natures> | |
|
15 | <nature>org.rubypeople.rdt.core.rubynature</nature> | |
|
16 | <nature>org.radrails.rails.core.railsnature</nature> | |
|
17 | </natures> | |
|
18 | </projectDescription> |
@@ -0,0 +1,5 | |||
|
1 | #Sun Nov 09 21:42:24 CET 2008 | |
|
2 | eclipse.preferences.version=1 | |
|
3 | encoding//app/helpers/ifpdf_helper.rb=UTF-8 | |
|
4 | encoding//test/fixtures/mail_handler=UTF-8 | |
|
5 | encoding/lang=UTF-8 |
@@ -71,6 +71,11 class User < ActiveRecord::Base | |||
|
71 | 71 | # update hashed_password if password was set |
|
72 | 72 | self.hashed_password = User.hash_password(self.password) if self.password |
|
73 | 73 | end |
|
74 | ||
|
75 | def reload(*args) | |
|
76 | @name = nil | |
|
77 | super | |
|
78 | end | |
|
74 | 79 | |
|
75 | 80 | def self.active |
|
76 | 81 | with_scope :find => { :conditions => [ "status = ?", STATUS_ACTIVE ] } do |
@@ -120,8 +125,7 class User < ActiveRecord::Base | |||
|
120 | 125 | |
|
121 | 126 | # Return user's full name for display |
|
122 | 127 | def name(formatter = nil) |
|
123 |
|
|
|
124 | eval '"' + f + '"' | |
|
128 | @name ||= eval('"' + (USER_FORMATS[formatter || Setting.user_format] || USER_FORMATS[:firstname_lastname]) + '"') | |
|
125 | 129 | end |
|
126 | 130 | |
|
127 | 131 | def active? |
@@ -180,14 +184,9 class User < ActiveRecord::Base | |||
|
180 | 184 | token && (token.created_on > Setting.autologin.to_i.day.ago) && token.user.active? ? token.user : nil |
|
181 | 185 | end |
|
182 | 186 | |
|
187 | # Sort users by their display names | |
|
183 | 188 | def <=>(user) |
|
184 | if user.nil? | |
|
185 | -1 | |
|
186 | elsif lastname.to_s.downcase == user.lastname.to_s.downcase | |
|
187 | firstname.to_s.downcase <=> user.firstname.to_s.downcase | |
|
188 | else | |
|
189 | lastname.to_s.downcase <=> user.lastname.to_s.downcase | |
|
190 | end | |
|
189 | self.to_s.downcase <=> user.to_s.downcase | |
|
191 | 190 | end |
|
192 | 191 | |
|
193 | 192 | def to_s |
@@ -85,9 +85,9 class UserTest < Test::Unit::TestCase | |||
|
85 | 85 | def test_name_format |
|
86 | 86 | assert_equal 'Smith, John', @jsmith.name(:lastname_coma_firstname) |
|
87 | 87 | Setting.user_format = :firstname_lastname |
|
88 | assert_equal 'John Smith', @jsmith.name | |
|
88 | assert_equal 'John Smith', @jsmith.reload.name | |
|
89 | 89 | Setting.user_format = :username |
|
90 | assert_equal 'jsmith', @jsmith.name | |
|
90 | assert_equal 'jsmith', @jsmith.reload.name | |
|
91 | 91 | end |
|
92 | 92 | |
|
93 | 93 | def test_lock |
General Comments 0
You need to be logged in to leave comments.
Login now