class QuestionJuridique < ActiveRecord::Base
  validates :name, :presence => true
  validates :firstname, :presence => true
  validates :question, :presence => true
  validates :email, :presence => true, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
  
  belongs_to :article
  
	scope :enableds, lambda { 
	        where(:enabled => true )
	    }
  
	scope :before, lambda { |date|
	        where("(question_juridiques.answer_at <= ?)", date )
          
	    }
  
end
