1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
nao0515ki 2018-04-14 22:28:01 +09:00
parent 662ba236d1
commit 8300268441

View file

@ -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
```