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:
parent
662ba236d1
commit
8300268441
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue