class Category < ActiveRecord::Base attr_accessible :name has_many :categorizations, :dependent => :restrict validates_presence_of :name validates :name, :uniqueness => {:scope => :type, :case_sensitive => false} def to_s "#{name}" end end