factory_bot 6.5.4 → 6.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0658ea1fd8d3b33128d6a88be3b64855cf80238bc0d2bf109f85a59b4398504f'
4
- data.tar.gz: 1cc9fb919e03d2ad95589e5519b19b1c8bd0ec1b6d0e45ee6479ff6d8f2541ad
3
+ metadata.gz: ffc4ecdfaad4faf3f66a090e8a67f73d399e6df92245cf77907b6483cc168b6d
4
+ data.tar.gz: f0445ea4b16381a1126775e0b127b3c4afd34ac23e9b0dd19930b84e267f8866
5
5
  SHA512:
6
- metadata.gz: '092799b8ba784bb640a2422ff8556d5c13c92a67b8224bd4730c4b2791995d4f56797ccf2815416e2fb21a474c41b47cc87df61564adae4cb3d0dc832c22f520'
7
- data.tar.gz: 1cc5060b814c06ed943ed825df2b913fb857b118837a850152f7b9044328de0a277f112365f10d8e66001d270b0059da77bef190ed712558c7186af00a1ccc4c
6
+ metadata.gz: 7b9e9db68e4fc0a222b6229c75391d23bc5014dfadd2e356bc74f037537749c60ee52f0cf4038bff5e5ba7488e9f4623db13a3b0b8d6f6a91fed1c41b0d5faac
7
+ data.tar.gz: d8002e39646803600784bb64cd1e611ecc0f056e2538a5496ca63d9804cb847582508b7558531fc5a15442077696de17316a7120abba8c1cbbe93cda71aa99b8
data/GETTING_STARTED.md CHANGED
@@ -219,6 +219,26 @@ It is also possible to explicitly specify the class:
219
219
  factory :admin, class: "User"
220
220
  ```
221
221
 
222
+ Explicit specification of the class, _with the full namespace_, is necessary when defining factories for classes nested within other modules or classes:
223
+
224
+ ```ruby
225
+ # foo/bar.rb
226
+ module Foo
227
+ class Bar
228
+ ...
229
+ end
230
+ end
231
+
232
+ # factories.rb
233
+ FactoryBot.define do
234
+ factory :bar, class: 'Foo::Bar' do
235
+ ...
236
+ end
237
+ end
238
+ ```
239
+
240
+ If the full namespace is not provided in the `factory` statement, you will receive a `NameError: uninitialized constant Bar` error.
241
+
222
242
  You can pass a constant as well, if the constant is available (note that this
223
243
  can cause test performance problems in large Rails applications, since
224
244
  referring to the constant will cause it to be eagerly loaded).