category.rb revision 8d0fb4fb93788e195e8fc2a48b243b3e53e6bd45
def self.arrange_as_array(options={}, hash=nil)
arr = []
arr << node
arr += arrange_as_array(options, children) unless children.nil?
end
arr
end
def name_for_selects
"#{'-' * depth} #{name}"
end
def possible_parents
parents = Category.arrange_as_array(:order => 'name')
return new_record? ? parents : parents - subtree
end
def to_s
name
end
end