git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.9-stable@3344
e93f8b46-1217-0410-a6f0-
8f06a7374b81
}
}
+ before_create :set_default_empty_values
+
def <=>(principal)
if self.class.name == principal.class.name
self.to_s.downcase <=> principal.to_s.downcase
principal.class.name <=> self.class.name
end
end
+
+ protected
+
+ # Make sure we don't try to insert NULL values (see #4632)
+ def set_default_empty_values
+ self.login ||= ''
+ self.hashed_password ||= ''
+ self.firstname ||= ''
+ self.lastname ||= ''
+ self.mail ||= ''
+ true
+ end
end