nil protection - mysql however has a default for enums, which is why it wasn't a...
authorAndy Allan <gravitystorm@gmail.com>
Mon, 10 Nov 2008 17:10:55 +0000 (17:10 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Mon, 10 Nov 2008 17:10:55 +0000 (17:10 +0000)
app/models/relation_member.rb

index 08bb988eec243117165e6e58de560558287ebbbf..1cb6d7131a6d1c434b0a1158a3f65ced3b5b90f6 100644 (file)
@@ -10,7 +10,7 @@ class RelationMember < ActiveRecord::Base
   end
 
   def after_initialize
-    self[:member_class] = self.member_type.capitalize
+      self[:member_class] = self.member_type.capitalize if !self.member_type.nil?
   end
 
   def before_save