1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use crate::;
/// The inverse side of a one-to-many relationship.
///
/// A `HasMany` field on model A means "A has many Bs". The actual foreign key
/// lives on model B as a [`BelongsTo`] field pointing back at A. The two
/// sides are linked via the [`pair`](HasMany::pair) field.
///
/// # Examples
///
/// ```ignore
/// // Given a `User` model that has many `Post`s:
/// let has_many: &HasMany = user_field.ty.as_has_many_unwrap();
/// let post_model = has_many.target(&schema);
/// let inverse = has_many.pair(&schema); // the BelongsTo on Post
/// ```