aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/models/node.rb
blob: 459ea8cf95323090c1c2cfe0ff7421116560435e (plain) (tree)
1
2
3
4
5

                               

                                                                                        
   
class Node < ActiveRecord::Base
  belongs_to :tree, touch: true
  belongs_to :parent,   class_name: "Node", touch: true, optional: true
  has_many   :children, class_name: "Node", foreign_key: :parent_id, dependent: :destroy
end