diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-04-20 16:30:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-20 16:30:06 -0400 |
commit | 1e56b31dd6810806e0f5593311ff624b0eb34443 (patch) | |
tree | 99450b7c2919b11c88b43d988f09464bf549cae0 /guides/source | |
parent | b10f371366a606310cab26648d798836e030bdc8 (diff) | |
parent | 8300268441a7cc53d3a274a0d542d16e18bf8771 (diff) | |
download | rails-1e56b31dd6810806e0f5593311ff624b0eb34443.tar.gz rails-1e56b31dd6810806e0f5593311ff624b0eb34443.tar.bz2 rails-1e56b31dd6810806e0f5593311ff624b0eb34443.zip |
Merge pull request #32572 from nao0515ki/add_optional_true_to_self_joins_section
[ci skip] belongs_to in self join association needs optional: true, if it's over 5.0 ver of rails
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/association_basics.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index 860a1e1cba..6fbd52edbd 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -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 ``` |