class MenuItemLang < ActiveRecord::Base
  belongs_to :lang_site
  belongs_to :menu_item
  validates :name, :presence => true #, :if => :force_validation?
  
  validates :slug, :presence => true
  
  #def force_validation?
  #  true if visible or enabled
  #end
  
  def url
    self.permalink
    
  end
  
  before_validation do
    
        
    
        if !self.slug?
    
          self.slug = self.name
  
      end
    
        self.slug = self.slug.to_slug
    
        #self.validate_permalink
  
    end
    
    
end
