提交 83002684 编写于 作者: N nao0515ki

[ci skip] belongs_to in self join association needs optional: true, if it's over 5.0 ver of rails

上级 662ba236
......@@ -505,7 +505,7 @@ class Employee < ApplicationRecord
has_many :subordinates, class_name: "Employee",
foreign_key: "manager_id"
belongs_to :manager, class_name: "Employee"
belongs_to :manager, class_name: "Employee", optional: true
end
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册