blob: ae46c76b46975d91a3f246a3200970a9637985ae (
plain) (
blame)
| 1
2
3
4
5
6
7
 | # frozen_string_literal: true
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
 |