From 0b0a3ed8f0e054454e47c931c1394d31fedb9afb Mon Sep 17 00:00:00 2001 From: Daniel Lo Date: Fri, 14 Jun 2013 02:30:55 +0000 Subject: [PATCH] Added some verbage explaining Custom Relation Names. The custom relation names initially confused me, because I was expecting more 'Magic'. --- source/en/mongoid/docs/relations.haml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/en/mongoid/docs/relations.haml b/source/en/mongoid/docs/relations.haml index 81a7ceb..be44dd6 100644 --- a/source/en/mongoid/docs/relations.haml +++ b/source/en/mongoid/docs/relations.haml @@ -96,6 +96,20 @@ embedded_in :alcoholic, class_name: "Lush", inverse_of: :whiskey end + %p + In class Lush :whiskey is the variable name of + the relation. This relation contains many classes named Drink. + The inverse_of: :alcoholic states that class Drink + will have a variable named :alcoholic containing the inverse + relationship pointing back to :whiskey. + + %p + In the class Drink, :alcoholic is the variable + name containing the relationship and that :alcoholic is a class + of Lush. Lush contains a variable named + :whiskey that points back to Drink. + + %h3 Validations %p