summaryrefslogtreecommitdiffhomepage
path: root/app/models/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/node.rb')
-rw-r--r--app/models/node.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
new file mode 100644
index 0000000..c6dab06
--- /dev/null
+++ b/app/models/node.rb
@@ -0,0 +1,5 @@
+class Node < ApplicationRecord
+ has_many :children, class_name: "Node"
+ belongs_to :parent, class_name: "Node", optional: true
+ accepts_nested_attributes_for :parent
+end