class Projet < ActiveRecord::Base

  belongs_to :image_file
  
  has_many :blocks, :as => :blockable
    
  after_create do
        
      LangSite.all.each do |lang|
        @block = Block.new(:block_name => "general", :lang_site => lang)
        @block.blockable = self
        @block.save
      
    end
  
  
  end
  
  before_validation do 
    self.slug = self.name.to_slug
  end
    

end
