User#<=> modified to sort on firstname if same lastname

git-svn-id: http://redmine.rubyforge.org/svn/trunk@446 e93f8b46-1217-0410-a6f0-8f06a7374b81
pull/351/head
Jean-Philippe Lang 18 years ago
parent 6c5e89ede0
commit 559b2069ac
  1. 2
      app/models/user.rb

@ -143,7 +143,7 @@ class User < ActiveRecord::Base
end
def <=>(user)
lastname <=> user.lastname
lastname == user.lastname ? firstname <=> user.firstname : lastname <=> user.lastname
end
private

Loading…
Cancel
Save