]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation_member.rb
Migration to add close-time to changesets. This replaces the boolean 'open' attribute...
[rails.git] / app / models / relation_member.rb
index 9ff4f46f3b8b0b6ae4fb1b02ba49ccab25a71b66..f3033d1c641494225b15dc77ac108ee623866249 100644 (file)
@@ -1,6 +1,7 @@
 class RelationMember < ActiveRecord::Base
   set_table_name 'current_relation_members'
   
+  set_primary_keys :id, :sequence_id
   belongs_to :member, :polymorphic => true, :foreign_type => :member_class
   belongs_to :relation, :foreign_key => :id
 
@@ -9,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 unless self.member_type.nil?
   end
 
   def before_save