class VideoFileLang < ActiveRecord::Base
  belongs_to :video_file
  belongs_to :lang_site
  
  validates :title, :presence => true
  validates :slug, :presence => true, :uniqueness => {:scope => :lang_site_id}
  
  
  before_validation do
    
      
  
    if !self.slug?

      self.slug = self.title

    end

    self.slug = self.slug.to_slug


  end
end
