diff options
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index bddb54354..96e7c5c39 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -58,7 +58,17 @@ class Member < ActiveRecord::Base def <=>(member) a, b = roles.sort.first, member.roles.sort.first - a == b ? (principal <=> member.principal) : (a <=> b) + if a == b + if principal + principal <=> member.principal + else + 1 + end + elsif a + a <=> b + else + 1 + end end def deletable? |