# -*- encoding : utf-8 -*-

class ForumMessage < ActiveRecord::Base
  belongs_to :forum_user
  attr_accessible :description, :title, :forum_topic_id, :forum_user, :forum_user_id
  
  validates :description, :presence => true
  
  belongs_to :topic, :class_name => "ForumTopic"
  belongs_to :forum_user
  def username
    if self.forum_user
    		self.forum_user.firstname.to_s+" "+
    		self.forum_user.name.to_s
    else
    		"utilisateur supprimé"
      end
  end
end
