class Contact < ActiveRecord::Base

  belongs_to :admin
  has_many :contact_actions
  validates :name, :presence => true
  validates :firstname, :presence => true
  validates :email, :presence => true,  :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
  #validates :message, :presence => true
  validates :message, :presence => true
  
  has_many :contact_files
  
  before_validation do
    self.contact_status = "En cours" if !self.contact_status?
    
  end
  
  STATUS = ["En cours","A abouti","Offre à faire","Pas de suite à donner", "Offre refusée"]
  

end
