You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, it generates random values for attributes and arguments that have `allow_nil?: false` and no default value (`default == nil`). In the example above, `author` and `title` fall into this category.
47
+
48
+
### Belongs To Relationships
45
49
46
-
By default, it generates random values for attributes and arguments that have `allow_nil?: false` and no default value (`default == nil`).
50
+
For attributes and arguments that match the `name` or `source_attribute` of a `belongs_to` relationship:
51
+
- In `create` actions, they are generated with `nil` values
52
+
- In other actions, they are not generated at all
53
+
54
+
This behavior exists because:
55
+
- In `create` actions, omitting a value is equivalent to setting it to `nil`
56
+
- In `update` actions, omitting a value preserves the existing relationship, while explicitly setting it to `nil` removes the relationship
57
+
58
+
### Options
47
59
48
60
-`populate`: Forces generation of random values for specified attributes/arguments, overriding the default behavior
49
61
-`omit`: Prevents generation of random values for specified attributes/arguments, overriding the default behavior
0 commit comments