##// END OF EJS Templates
Fixed: NOT NULL constraint error when adding a group (#4632)....
Jean-Philippe Lang -
r3229:12ea682b6639
parent child
Show More
@@ -32,6 +32,8 class Principal < ActiveRecord::Base
32 32 }
33 33 }
34 34
35 before_create :set_default_empty_values
36
35 37 def <=>(principal)
36 38 if self.class.name == principal.class.name
37 39 self.to_s.downcase <=> principal.to_s.downcase
@@ -40,4 +42,16 class Principal < ActiveRecord::Base
40 42 principal.class.name <=> self.class.name
41 43 end
42 44 end
45
46 protected
47
48 # Make sure we don't try to insert NULL values (see #4632)
49 def set_default_empty_values
50 self.login ||= ''
51 self.hashed_password ||= ''
52 self.firstname ||= ''
53 self.lastname ||= ''
54 self.mail ||= ''
55 true
56 end
43 57 end
General Comments 0
You need to be logged in to leave comments. Login now