Define Principal#name so all subclasses will have some sort of name when printed.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4076 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3a2efb4757
commit
4c656fcffc
|
@ -34,6 +34,10 @@ class Principal < ActiveRecord::Base
|
|||
|
||||
before_create :set_default_empty_values
|
||||
|
||||
def name(formatter = nil)
|
||||
to_s
|
||||
end
|
||||
|
||||
def <=>(principal)
|
||||
if self.class.name == principal.class.name
|
||||
self.to_s.downcase <=> principal.to_s.downcase
|
||||
|
|
Loading…
Reference in New Issue