class PrivateMessage < ActiveRecord::Base belongs_to :user belongs_to :target, :class_name => 'User', :foreign_key => 'target_id' # user_id: 发送者id,非真实发送者id # target_id: 接受者id,非真实接受者id # sender_id:发送者id,真实的发送者id # receiver_id:接受者id,真实的接受者id # content:消息内容 # send_time:消息发送时间 # status:消息状态 0:未读 1:已读 2:删除,标记不同消息状态 attr_accessible :content, :receiver_id, :send_time, :sender_id, :status, :target_id, :user_id end