2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-10-19 21:58:31 +01:00
|
|
|
class Category < ActiveRecord::Base
|
|
|
|
has_many :projects, :dependent => :nullify
|
|
|
|
|
|
|
|
validates :name, :presence => true
|
|
|
|
|
2012-02-28 10:35:17 +00:00
|
|
|
default_scope order('categories.name')
|
2011-10-19 21:58:31 +01:00
|
|
|
|
|
|
|
has_ancestry
|
|
|
|
end
|