class ForumUser < ActiveRecord::Base
  attr_accessible :bio, :email, :firstname, :name, :password, :password_confirmation, :avatar, :moderator
  
  has_secure_password
  validates_presence_of :password, :on => :create
  validates_presence_of :email, :presence => true, :uniqueness => true
  
  mount_uploader :avatar, AvatarUploader
  
  has_many :messages, :class_name => "ForumMessage"
  has_many :topics, :class_name => "ForumTopic"
  
  has_many :images, :class_name => "ForumUserImage", :order => "created_at DESC"
end
