Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Extra Verbage for Custom Relation Names #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions source/en/mongoid/docs/relations.haml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@
embedded_in :alcoholic, class_name: "Lush", inverse_of: :whiskey
end

%p
In class <code>Lush</code> <code>:whiskey</code> is the variable name of
the relation. This relation contains many classes named <code>Drink</code>.
The <code>inverse_of: :alcoholic</code> states that class <code>Drink</code>
will have a variable named <code>:alcoholic</code> containing the inverse
relationship pointing back to <code>:whiskey</code>.

%p
In the class <code>Drink</code>, <code>:alcoholic</code> is the variable
name containing the relationship and that <code>:alcoholic</code> is a class
of <code>Lush</code>. <code>Lush</code> contains a variable named
<code>:whiskey</code> that points back to <code>Drink</code>.


%h3 Validations

%p
Expand Down