1 class RelationMember < ActiveRecord::Base
2 set_table_name 'current_relation_members'
4 belongs_to :member, :polymorphic => true, :foreign_type => :member_class
5 belongs_to :relation, :foreign_key => :id
8 self[:member_class] = self.member_type.capitalize
12 self[:member_class] = self.member_type.capitalize
16 self.member_type = self[:member_class].downcase
19 def member_type=(type)
20 self[:member_type] = type
21 self[:member_class] = type.capitalize