    # File lib/active_record/acts/tree.rb, line 42
            def acts_as_tree(options = {})
              configuration = { :foreign_key => "parent_id", :order => nil, :counter_cache => nil }
              configuration.update(options) if options.is_a?(Hash)

              belongs_to :parent, :class_name => name, :foreign_key => configuration[:foreign_key], :counter_cache => configuration[:counter_cache]
              has_many :children, :class_name => name, :foreign_key => configuration[:foreign_key], :order => configuration[:order], :dependent => :destroy

              class_eval "include ActiveRecord::Acts::Tree::InstanceMethods\n\ndef self.roots\nfind(:all, :conditions => \"\#{configuration[:foreign_key]} IS NULL\", :order => \#{configuration[:order].nil? ? \"nil\" : %Q{\"\#{configuration[:order]}\"}})\nend\n\ndef self.root\nfind(:first, :conditions => \"\#{configuration[:foreign_key]} IS NULL\", :order => \#{configuration[:order].nil? ? \"nil\" : %Q{\"\#{configuration[:order]}\"}})\nend\n"
            end