class Category < ActiveRecord::Base
	has_many :articles
	
	validates :name, :presence => true, :uniqueness => true
	validates :slug, :presence => true, :uniqueness => true
	
	before_validation do
		self.slug = self.name.to_slug
		
	end

end
