Skip to content

Commit 19d7118

Browse files
committed
SA PR fixes 1
1 parent 253cc80 commit 19d7118

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

source/data-modeling/inheritance.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ In this guide, you can learn how to implement **inheritance** into your
2424
{+odm+} models. Inheritance allows you to apply the characteristics of
2525
one "parent" class to one or more "child" classes.
2626

27-
{+odm+} supports inheritance in top level and embedded documents.
27+
{+odm+} supports inheritance in top-level and embedded documents.
2828
When a child model class inherits from a parent class, {+odm+} copies
2929
the parent class's fields, associations, validations, and scopes to
3030
the child class.
@@ -44,11 +44,10 @@ demonstrate how to create parent and child classes between the
4444
:emphasize-lines: 7, 14
4545
:dedent:
4646

47-
When you perform data operations by using the preceding models,
48-
instances of ``Person``, ``Employee``, or ``Manager`` are all saved in the
49-
``people`` collection. {+odm+} sets the ``_type`` discriminator field to
50-
the model class name in documents to ensure that documents are returned
51-
as the expected types when you retrieve them.
47+
{+odm+} saves instances of ``Person``, ``Employee``, and ``Manager`` in
48+
the ``people`` collection. {+odm+} sets the ``_type`` discriminator
49+
field to the model class name in documents to ensure that documents are
50+
returned as the expected types when you perform read operations.
5251

5352
Embedded Documents
5453
~~~~~~~~~~~~~~~~~~
@@ -73,7 +72,7 @@ Query Behavior
7372
~~~~~~~~~~~~~~
7473

7574
When you query on a child model class, the query returns only documents
76-
in which the value of the ``_type`` field match the queried class or
75+
in which the value of the ``_type`` field matches the queried class or
7776
further child classes. For example, if you query on the ``Employee``
7877
class, the query returns documents from the ``people`` collection in
7978
which the ``_type`` value is either ``"Employee"`` or ``"Manager"``. All
@@ -190,11 +189,13 @@ name.
190189

191190
Because the discriminator value customization is declared in child classes,
192191
you must load the child classes retrieved by a query *before* sending
193-
that query. In the preceding example, the ``Employee`` class definition
194-
must be loaded before you query on ``Person`` if the returned documents could
195-
potentially be instances of ``Employee``. Autoloading isn't able to resolve
196-
the discriminator value ``"Worker"`` to return the document as an
197-
instance of ``Employee``.
192+
that query.
193+
194+
In the preceding example, the ``Employee`` class definition must be
195+
loaded before you query on ``Person`` if the returned documents include
196+
instances of ``Employee``. Autoloading cannot resolve the
197+
discriminator value ``"Worker"`` to return documents as instances of
198+
``Employee``.
198199

199200
Embedded Associations
200201
---------------------

0 commit comments

Comments
 (0)