factory_bot 6.5.1 → 6.6.0

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.
data/NEWS.md CHANGED
@@ -1,477 +1,607 @@
1
1
  # News
2
2
 
3
+ ## 6.6.0 (May 4, 2026)
4
+
5
+ * Feat: Added `factory_bot.before_run_factory` instrumentation event
6
+ * Add workflow to prepare a release PR by @neilvcarvalho in [#1816](https://github.com/thoughtbot/factory_bot/pull/1816)
7
+ * Add gem release workflow with GitHub release notes from changelog by @neilvcarvalho in [#1815](https://github.com/thoughtbot/factory_bot/pull/1815)
8
+ * Require MFA for gem pushes by @MatheusRich in [#1814](https://github.com/thoughtbot/factory_bot/pull/1814)
9
+ * Add `factory_bot.before_run_factory` instrumentation event by @hammadxcm in [#1795](https://github.com/thoughtbot/factory_bot/pull/1795)
10
+ * Remove CodeClimate badge from README by @hammadxcm in [#1794](https://github.com/thoughtbot/factory_bot/pull/1794)
11
+ * Update CI matrix by @berkos in [#1793](https://github.com/thoughtbot/factory_bot/pull/1793)
12
+ * Bump actions/checkout from 5 to 6 by @app/dependabot in [#1791](https://github.com/thoughtbot/factory_bot/pull/1791)
13
+ * Ensure linting transactions don't interfere with ActiveRecord lifecycle by @NikolasPilavakis in [#1790](https://github.com/thoughtbot/factory_bot/pull/1790)
14
+ * removes @doodlingdev by @DoodlingDev in [#1789](https://github.com/thoughtbot/factory_bot/pull/1789)
15
+ * DefinitionProxy#method_missing: Forward given block to #association by @grekko in [#1579](https://github.com/thoughtbot/factory_bot/pull/1579)
16
+
17
+ ## 6.5.6 (October 22, 2025)
18
+
19
+ * Fix: Enforce association override precedence over trait foreign keys by @JinOketani in [#1768](https://github.com/thoughtbot/factory_bot/pull/1768)
20
+ * Build: Add ostruct as a development dependency by @ydah in [#1778](https://github.com/thoughtbot/factory_bot/pull/1778)
21
+ * Build: Bump standard from v1.44.0 to v1.51.1 by @ydah in [#1779](https://github.com/thoughtbot/factory_bot/pull/1779)
22
+ * Build: Add Ruby 3.4 to CI matrix by @ydah in [#1780](https://github.com/thoughtbot/factory_bot/pull/1780)
23
+ * Build: Remove unnecessary development dependencies by @ydah in [#1781](https://github.com/thoughtbot/factory_bot/pull/1781)
24
+ * Build: update gem versions and dependencies by @ydah in [#1782](https://github.com/thoughtbot/factory_bot/pull/1782)
25
+ * Build: revert removal of mutex_m by @vburzynski in [#1784](https://github.com/thoughtbot/factory_bot/pull/1784)
26
+ * Refactor: factory calculator cleanup by @vburzynski in [#1770](https://github.com/thoughtbot/factory_bot/pull/1770)
27
+ * Chore(ci): Bump actions/checkout from 4 to 5 by @dependabot[bot] in [#1765](https://github.com/thoughtbot/factory_bot/pull/1765)
28
+ * Chore(specs): tag slow specs by @vburzynski in [#1776](https://github.com/thoughtbot/factory_bot/pull/1776)
29
+ * Docs: Update RELEASING.md by @vburzynski in [#1763](https://github.com/thoughtbot/factory_bot/pull/1763)
30
+ * Docs: Update link to FactoryGirl upgrade guide by @imRohan in [#1769](https://github.com/thoughtbot/factory_bot/pull/1769)
31
+ * Docs: Fix some typos by @ydah in [#1783](https://github.com/thoughtbot/factory_bot/pull/1783)
32
+ * Docs(yard): resolve yard doc warnings by @vburzynski in [#1764](https://github.com/thoughtbot/factory_bot/pull/1764)
33
+ * Docs(yard): ruby syntax highlighting in yard docs by @djbender in [#1777](https://github.com/thoughtbot/factory_bot/pull/1777)
34
+
35
+ ## 6.5.5 (August 15, 2025)
36
+
37
+ * Feat: Adds developer console features (CodeMeister)
38
+ * adds `bin/setup` to run bundle install
39
+ * adds `bin/console` to open an IRB console with factory_bot loaded
40
+ * adds a session method `reload!` will reload all gem files.
41
+ * Feat: Before(:all) and after(:all) callbacks added (CodeMeister)
42
+ * Feat: Adds support for before build callback (Mohammed Nasser and Neil Carvalho)
43
+ * Feat: Adds support for lazy loaded initial value sequences (AJ Esler)
44
+ * Fix: Refactors the removal of files from the loaded register in `.irbrc` (CodeMeister)
45
+ * Fix: Improves the sequence handling with better context support (CodeMeister)
46
+ * Fixes issue #1754 where `#generate` was throwing an error
47
+ * Refactors the `#increment_sequence` method to remove the URI requirement
48
+ * Fix: Cleans up ActiveSupport core extensions (Neil Carvalho)
49
+ * Fix: Addresses issue #1709 with resolution of conflict between '<attribute>' and '<attribute_id>` (CodeMeister)
50
+ * Fix: Addresses issue #1712 by ensuring callbacks only run once per instance (CodeMeister)
51
+ * Docs: Downcase of the word "constants" in `.irbrc` file (CodeMeister)
52
+ * Docs: Update docs with note clarifying when the full namespace is required in a factory (John Pitchko)
53
+ * Chore: Add new maintainers to CODEOWNERS (Ajina Slater)
54
+
55
+ ## 6.5.4 (June 13, 2025)
56
+
57
+ * Fix bug where user-defined method named `definition` could not be set through `method_missing` in factories. (CodeMeister)
58
+
59
+ ## 6.5.3 (June 2, 2025)
60
+
61
+ * Fix: Factory sequences without blocks (CodeMeister)
62
+ * Added: New methods for setting, generating and rewinding sequences (CodeMeister)
63
+
64
+ ## 6.5.2 (May 30, 2025)
65
+
66
+ * Changed: Updated "verbose linting" test to allow for backtrace changes in Ruby 3.4 (CodeMeister)
67
+ * Fix: Set the same timestamps for `created_at` and `updated_at` on `build_stubbed` (Kim Emmanuel)
68
+ * Fix: Refactored sequences to ensure cloned traits use parent sequences. (CodeMeister)
69
+ * Docs: Fix definition_file_paths comment (Milo Winningham)
70
+ * Docs: Add ruby-lsp extensions to Useful Tools in README.md (johansenja)
71
+ * Docs: Fix docs about definition file paths (Ryo Nakamura)
72
+ * Docs: Update has_many-associations.md to mention that traits can use inline associations (Matthew Zagaja)
73
+ * Docs: Fix "Transitioning from Factory Girl" guide link (Neil Carvalho)
74
+
3
75
  ## 6.5.1 (January 31, 2025)
4
76
 
5
- * Changed: execute linting tests within ActiveRecord transactions when available (Sean Doyle)
6
- * Fix: Random test failure when tracking compilation time (CodeMeinster)
7
- * Fix: Bump the minimum required activesupport version to 6.1 (Earlopain)
8
- * Internal: Update development dependencies (Neil Carvalho)
77
+ * Changed: execute linting tests within ActiveRecord transactions when available (Sean Doyle)
78
+ * Fix: Random test failure when tracking compilation time (CodeMeister)
79
+ * Fix: Bump the minimum required activesupport version to 6.1 (Earlopain)
80
+ * Internal: Update development dependencies (Neil Carvalho)
9
81
 
10
82
  ## 6.5.0 (September 6, 2024)
11
83
 
12
- * fix: issue 1621 broken links in ref/factory.md by @elasticspoon in https://github.com/thoughtbot/factory_bot/pull/1623
13
- * Add standard settings by @ydah in https://github.com/thoughtbot/factory_bot/pull/1625
14
- * Call dynamic-readme reusable workflow by @stefannibrasil in https://github.com/thoughtbot/factory_bot/pull/1628
15
- * Update README again by @stefannibrasil in https://github.com/thoughtbot/factory_bot/pull/1630
16
- * Only run this workflow if the README has been updated by @stefannibrasil in https://github.com/thoughtbot/factory_bot/pull/1635
17
- * Automatically Generated: Update Dynamic Section in README by @github-actions in https://github.com/thoughtbot/factory_bot/pull/1637
18
- * Added a case for build_class to handle class names with underscores passed as a string by @m-gizzi in https://github.com/thoughtbot/factory_bot/pull/1642
19
- * Add Ruby 3.3 to CI by @berkos in https://github.com/thoughtbot/factory_bot/pull/1615
20
- * Update Dependabot configuration by @smaboshe in https://github.com/thoughtbot/factory_bot/pull/1655
21
- * Add new maintainers to CODEOWNERS by @sarahraqueld in https://github.com/thoughtbot/factory_bot/pull/1651
22
- * Improve docs formatting and fix filename conflicts by @sarahraqueld in https://github.com/thoughtbot/factory_bot/pull/1666
23
- * Add a dynamic security workflow and a SECURITY.md file by @sarahraqueld in https://github.com/thoughtbot/factory_bot/pull/1677
24
- * Automatically Generated: Update Dynamic Section in SECURITY by @github-actions in https://github.com/thoughtbot/factory_bot/pull/1678
25
- * Ensure rails 7.2 compatibility by @Earlopain in https://github.com/thoughtbot/factory_bot/pull/1686
26
- * Fix the factory definition in traits documentation by @ddieulivol in https://github.com/thoughtbot/factory_bot/pull/1688
84
+ * fix: issue 1621 broken links in ref/factory.md by @elasticspoon in https://github.com/thoughtbot/factory_bot/pull/1623
85
+ * Add standard settings by @ydah in https://github.com/thoughtbot/factory_bot/pull/1625
86
+ * Call dynamic-readme reusable workflow by @stefannibrasil in https://github.com/thoughtbot/factory_bot/pull/1628
87
+ * Update README again by @stefannibrasil in https://github.com/thoughtbot/factory_bot/pull/1630
88
+ * Only run this workflow if the README has been updated by @stefannibrasil in https://github.com/thoughtbot/factory_bot/pull/1635
89
+ * Automatically Generated: Update Dynamic Section in README by @github-actions in https://github.com/thoughtbot/factory_bot/pull/1637
90
+ * Added a case for build_class to handle class names with underscores passed as a string by @m-gizzi in https://github.com/thoughtbot/factory_bot/pull/1642
91
+ * Add Ruby 3.3 to CI by @berkos in https://github.com/thoughtbot/factory_bot/pull/1615
92
+ * Update Dependabot configuration by @smaboshe in https://github.com/thoughtbot/factory_bot/pull/1655
93
+ * Add new maintainers to CODEOWNERS by @sarahraqueld in https://github.com/thoughtbot/factory_bot/pull/1651
94
+ * Improve docs formatting and fix filename conflicts by @sarahraqueld in https://github.com/thoughtbot/factory_bot/pull/1666
95
+ * Add a dynamic security workflow and a SECURITY.md file by @sarahraqueld in https://github.com/thoughtbot/factory_bot/pull/1677
96
+ * Automatically Generated: Update Dynamic Section in SECURITY by @github-actions in https://github.com/thoughtbot/factory_bot/pull/1678
97
+ * Ensure rails 7.2 compatibility by @Earlopain in https://github.com/thoughtbot/factory_bot/pull/1686
98
+ * Fix the factory definition in traits documentation by @ddieulivol in https://github.com/thoughtbot/factory_bot/pull/1688
27
99
 
28
100
  ## 6.4.6 (January 30, 2023)
29
101
 
30
- * Fix: Bump minimum required Ruby in gemspec (Earlopain).
31
- * Fix: Broken link in `FactoryBot.modify` docs (Matt Brictson).
32
- * Fix: Broken link in `FactoryBot.lint` docs (Anton Dieterle).
102
+ * Fix: Bump minimum required Ruby in gemspec (Earlopain).
103
+ * Fix: Broken link in `FactoryBot.modify` docs (Matt Brictson).
104
+ * Fix: Broken link in `FactoryBot.lint` docs (Anton Dieterle).
33
105
 
34
106
  ## 6.4.5 (December 29, 2023)
35
107
 
36
- * Changed: Support Ruby 3.0+, Rails 6.1+ (Mike Burns).
108
+ * Changed: Support Ruby 3.0+, Rails 6.1+ (Mike Burns).
37
109
 
38
110
  ## 6.4.4 (December 27, 2023)
39
111
 
40
- * Internal: Remove observer dependency (Earlopain).
112
+ * Internal: Remove observer dependency (Earlopain).
41
113
 
42
114
  ## 6.4.3 (December 26, 2023)
43
115
 
44
- * Fix: Support models without ID setters in build_stubbed (Olivier Bellone).
45
- * Fix: Explicit observer dependency (Oleg Antonyan).
46
- * Internal: Add Rails 7.1 to CI (Olivier Bellone).
47
- * Internal: Bump github actions/checkout to v4 (Lorenzo Zabot)
48
- * Internal: Stop passing disable-error_highlight in CI (Mike Burns).
49
- * Internal: Relax the exception message check (Mike Burns).
116
+ * Fix: Support models without ID setters in build_stubbed (Olivier Bellone).
117
+ * Fix: Explicit observer dependency (Oleg Antonyan).
118
+ * Internal: Add Rails 7.1 to CI (Olivier Bellone).
119
+ * Internal: Bump github actions/checkout to v4 (Lorenzo Zabot)
120
+ * Internal: Stop passing disable-error_highlight in CI (Mike Burns).
121
+ * Internal: Relax the exception message check (Mike Burns).
50
122
 
51
123
  ## 6.4.2 (November 22, 2023)
52
124
 
53
- * Fix: top-level traits pass their class to ActiveSupport::Notifications
54
- (makicamel).
125
+ * Fix: top-level traits pass their class to ActiveSupport::Notifications (makicamel).
55
126
 
56
127
  ## 6.4.1 (November 20, 2023)
57
128
 
58
- * Fix: factories with traits pass their class to ActiveSupport::Notifications
59
- (makicamel).
129
+ * Fix: factories with traits pass their class to ActiveSupport::Notifications
130
+ (makicamel).
60
131
 
61
132
  ## 6.4.0 (November 17, 2023)
62
133
 
63
- * Added: if `build_stubbed` detects a UUID primary key, generate the correct
64
- type (Peter Boling, Alexandre Ruban).
65
- * Docs: show examples of Ruby 3 syntactic sugars (Sean Doyle).
66
- * Internal: resolve test warning messages (Mike Burns).
67
-
134
+ * Added: if `build_stubbed` detects a UUID primary key, generate the correct
135
+ type (Peter Boling, Alexandre Ruban).
136
+ * Docs: show examples of Ruby 3 syntactic sugars (Sean Doyle).
137
+ * Internal: resolve test warning messages (Mike Burns).
68
138
 
69
139
  ## 6.3.0 (September 1, 2023)
70
140
 
71
- * Fix: link to changelog for RubyGems (Berkan Ünal).
72
- * Fix: integrate with Ruby 3.2's `did_you_mean` library (Daniel Colson).
73
- * Changed: explicitly define `#destroyed?` within the `Stub` strategy to return `false` to be consistent
74
- with ActiveRecord (Benjamin Fleischer).
75
- * Added: announce `factory_bot.compile_factory` notification (Sean Doyle).
76
- * Docs: clarify that custom strategies need to define `#to_sym` (Edmund Korley, Jonas S).
77
- * Docs: fix CI link in README (Mark Huk).
78
- * Docs: fix GitHub links (Robert Fletcher).
79
- * Docs: install this library with `bundle add` (Glauco Custódio).
80
- * Docs: re-write into mdBook (Mike Burns, Sara Jackson, Stefanni Brasil)
81
- * Docs: clarify that automatic trait definitions could introduce new linting errors (Lawrence Chou).
82
- * Internal: skip TruffleRuby on Rails 5.0, 5.1, 5.2 (Andrii Konchyn).
83
- * Internal: fix typoes throughout codebase (Yudai Takada).
84
- * Internal: run CI on `actions/checkout` v3 (Yudai Takada).
85
- * Internal: follow standardrb code style (Yudai Takada).
86
- * Internal: stop using Hound (Daniel Nolan).
87
- * Internal: only run simplecov on C Ruby (Daniel Colson).
88
- * Internal: quieter Cucumber (Daniel Colson).
89
- * Internal: Ruby 3.2 support (Daniel Colson).
90
- * Internal: Mike Burns is the CODEOWNER (Stefanni Brasil).
141
+ * Fix: link to changelog for RubyGems (Berkan Ünal).
142
+ * Fix: integrate with Ruby 3.2's `did_you_mean` library (Daniel Colson).
143
+ * Changed: explicitly define `#destroyed?` within the `Stub` strategy to return `false` to be consistent
144
+ with ActiveRecord (Benjamin Fleischer).
145
+ * Added: announce `factory_bot.compile_factory` notification (Sean Doyle).
146
+ * Docs: clarify that custom strategies need to define `#to_sym` (Edmund Korley, Jonas S).
147
+ * Docs: fix CI link in README (Mark Huk).
148
+ * Docs: fix GitHub links (Robert Fletcher).
149
+ * Docs: install this library with `bundle add` (Glauco Custódio).
150
+ * Docs: re-write into mdBook (Mike Burns, Sara Jackson, Stefanni Brasil)
151
+ * Docs: clarify that automatic trait definitions could introduce new linting errors (Lawrence Chou).
152
+ * Internal: skip TruffleRuby on Rails 5.0, 5.1, 5.2 (Andrii Konchyn).
153
+ * Internal: fix typos throughout codebase (Yudai Takada).
154
+ * Internal: run CI on `actions/checkout` v3 (Yudai Takada).
155
+ * Internal: follow standardrb code style (Yudai Takada).
156
+ * Internal: stop using Hound (Daniel Nolan).
157
+ * Internal: only run simplecov on C Ruby (Daniel Colson).
158
+ * Internal: quieter Cucumber (Daniel Colson).
159
+ * Internal: Ruby 3.2 support (Daniel Colson).
160
+ * Internal: Mike Burns is the CODEOWNER (Stefanni Brasil).
91
161
 
92
162
  ## 6.2.1 (March 8, 2022)
93
- * Added: CI testing against truffleruby
94
- * Changed: Documentation improvements for sequences and traits
95
- * Fixed: ActiveSupport::Notifications reporting strategy through associations now report as symbols
96
- * BREAKING CHANGE: Custom strategies now need to define a `to_sym` method to specify the strategy identifier
97
- * Fixed: `add_attribute` with reserved keywords assigns values correctly
163
+
164
+ * Added: CI testing against truffleruby
165
+ * Changed: Documentation improvements for sequences and traits
166
+ * Fixed: ActiveSupport::Notifications reporting strategy through associations now report as symbols
167
+ * BREAKING CHANGE: Custom strategies now need to define a `to_sym` method to specify the strategy identifier
168
+ * Fixed: `add_attribute` with reserved keywords assigns values correctly
98
169
 
99
170
  ## 6.2.0 (May 7, 2021)
100
- * Added: support for Ruby 3.0
101
- * Changed: Include factory or trait name in error messages for missing traits. d05a9a3c
102
- * Changed: Switched from Travis CI to GitHub Actions
103
- * Fixed: More Ruby 2.7 kwarg deprecation warnings
171
+
172
+ * Added: support for Ruby 3.0
173
+ * Changed: Include factory or trait name in error messages for missing traits. d05a9a3c
174
+ * Changed: Switched from Travis CI to GitHub Actions
175
+ * Fixed: More Ruby 2.7 kwarg deprecation warnings
104
176
 
105
177
  ## 6.1.0 (July 8, 2020)
106
- * Added: public reader for the evaluation instance, helpful for building interrelated associations
107
- * Changed: raise a more helpful error when passing an invalid argument to an association
108
- * Fixed: Ruby 2.7 kwarg deprecation warnings
178
+
179
+ * Added: public reader for the evaluation instance, helpful for building interrelated associations
180
+ * Changed: raise a more helpful error when passing an invalid argument to an association
181
+ * Fixed: Ruby 2.7 kwarg deprecation warnings
109
182
 
110
183
  ## 6.0.2 (June 19, 2020)
111
- * Fixed: bug causing traits to consume more memory each time they were used
184
+
185
+ * Fixed: bug causing traits to consume more memory each time they were used
112
186
 
113
187
  ## 6.0.1 (June 19, 2020)
114
- * Fixed: bug with constant resolution causing unexpected uninitialized constant errors
188
+
189
+ * Fixed: bug with constant resolution causing unexpected uninitialized constant errors
115
190
 
116
191
  ## 6.0.0 (June 18, 2020)
117
- * Added: automatic definition of traits for Active Record enum attributes, enabled by default
118
- (Note that this required changing where factory_bot constantizes the build
119
- class, which may affect applications that were using abstract factories for
120
- inheritance. See issue #1409.) (This may break `FactoryBot.lint` because
121
- there may be previously non-existing factory+trait combinations being
122
- defined and checked)
123
- * Added: `traits_for_enum` method to define traits for non-Active Record enums
124
- * Added: `build_stubbed_starting_id=` option to define the starting id for `build_stubbed`
125
- * Removed: deprecated methods on the top-level `FactoryBot` module meant only for internal use
126
- * Removed: support for EOL versions of Ruby (2.3, 2.4) and Rails (4.2)
127
- * Removed: support for "abstract" factories with no associated class; use traits instead.
192
+
193
+ * Added: automatic definition of traits for Active Record enum attributes, enabled by default
194
+ (Note that this required changing where factory_bot constantizes the build
195
+ class, which may affect applications that were using abstract factories for
196
+ inheritance. See issue #1409.) (This may break `FactoryBot.lint` because
197
+ there may be previously non-existing factory+trait combinations being
198
+ defined and checked)
199
+ * Added: `traits_for_enum` method to define traits for non-Active Record enums
200
+ * Added: `build_stubbed_starting_id=` option to define the starting id for `build_stubbed`
201
+ * Removed: deprecated methods on the top-level `FactoryBot` module meant only for internal use
202
+ * Removed: support for EOL versions of Ruby (2.3, 2.4) and Rails (4.2)
203
+ * Removed: support for "abstract" factories with no associated class; use traits instead.
128
204
 
129
205
  ## 5.2.0 (April 24, 2020)
130
- * Added: Pass index to block for `*_list` methods
131
- * Deprecated: methods on the top-level `FactoryBot` module meant only for internal use: `callbacks`, `configuration`, `constructor`, `initialize_with`, `register_sequence`, `resent_configuration`, `skip_create`, `to_create`
206
+
207
+ * Added: Pass index to block for `*_list` methods
208
+ * Deprecated: methods on the top-level `FactoryBot` module meant only for internal use: `callbacks`, `configuration`, `constructor`, `initialize_with`, `register_sequence`, `resent_configuration`, `skip_create`, `to_create`
132
209
 
133
210
  ## 5.1.2 (March 25, 2020)
134
- * Fixed: Ruby 2.7 keyword deprecation warning in FactoryBot.lint
211
+
212
+ * Fixed: Ruby 2.7 keyword deprecation warning in FactoryBot.lint
135
213
 
136
214
  ## 5.1.1 (October 2, 2019)
137
- * Improved: performance of traits
138
- * Fixed: registering strategies on JRuby
215
+
216
+ * Improved: performance of traits
217
+ * Fixed: registering strategies on JRuby
139
218
 
140
219
  ## 5.1.0 (September 21, 2019)
141
- * Added: "Did you mean?" style error message to help with typos in association declarations
142
- * Changed: `NoMethodError` for static attributes now offers a "Did you mean?" style message
143
- * Fixed: avoid undefining inherited evaluator methods
144
- * Fixed: avoid stubbing id for records without a primary key
145
- * Fixed: raise a helpful error for self-referencing traits to avoid a `SystemStackError`
146
- * Deprecated: methods on the top-level `FactoryBot` module meant only for internal use: `allow_class_lookup`, `allow_class_lookup`=, `register_trait`, `trait_by_name`, `traits`, `sequence_by_name`, `sequences`, `factory_by_name`, `register_factory`, `callback_names`, `register_callback`, `register_default_callbacks`, `register_default_strategies`, `strategies`
220
+
221
+ * Added: "Did you mean?" style error message to help with typos in association declarations
222
+ * Changed: `NoMethodError` for static attributes now offers a "Did you mean?" style message
223
+ * Fixed: avoid undefining inherited evaluator methods
224
+ * Fixed: avoid stubbing id for records without a primary key
225
+ * Fixed: raise a helpful error for self-referencing traits to avoid a `SystemStackError`
226
+ * Deprecated: methods on the top-level `FactoryBot` module meant only for internal use: `allow_class_lookup`, `allow_class_lookup`=, `register_trait`, `trait_by_name`, `traits`, `sequence_by_name`, `sequences`, `factory_by_name`, `register_factory`, `callback_names`, `register_callback`, `register_default_callbacks`, `register_default_strategies`, `strategies`
147
227
 
148
228
  ## 5.0.2 (February 22, 2019)
149
- * Bugfix: raise "Trait not registered" error when passing invalid trait arguments
229
+
230
+ * Bugfix: raise "Trait not registered" error when passing invalid trait arguments
150
231
 
151
232
  ## 5.0.1 (February 15, 2019)
152
- * Bugfix: Do not raise error when two sequences have the same name
153
- in two traits that have the same name
233
+
234
+ * Bugfix: Do not raise error when two sequences have the same name
235
+ in two traits that have the same name
154
236
 
155
237
  ## 5.0.0 (February 1, 2019)
156
- * Added: Verbose option to include full backtraces in the linting output
157
- * Changed: use_parent_strategy now defaults to true, so by default the
158
- build strategy will build, rather than create associations
159
- * Changed: Passing a block when defining associations now raises an error
160
- * Bugfix: use_parent_strategy is no longer reset by FactoryBot.reload
161
- * Bugfix: rewind_sequences will now rewind local sequences along with the global ones
162
- * Bugfix: the build_stubbed strategy now sets timestamps without changing the
163
- the original behavior of the timestamp methods
164
- * Bugfix: avoid a stack error when referring to an "attributes" attribute in initialize_with
165
- * Removed: support for EOL versions of Ruby and Rails
166
- * Removed: static attributes (use dynamic attributes with a block instead)
167
- * Removed: looking up factories by class
168
- * Removed: ignore method (use transient instead)
169
- * Removed: duplicate_attribute_assignment_from_initialize_with configuration option
170
- * Deprecated: allow_class_lookup configuration option
238
+
239
+ * Added: Verbose option to include full backtraces in the linting output
240
+ * Changed: use_parent_strategy now defaults to true, so by default the
241
+ build strategy will build, rather than create associations
242
+ * Changed: Passing a block when defining associations now raises an error
243
+ * Bugfix: use_parent_strategy is no longer reset by FactoryBot.reload
244
+ * Bugfix: rewind_sequences will now rewind local sequences along with the global ones
245
+ * Bugfix: the build_stubbed strategy now sets timestamps without changing the
246
+ the original behavior of the timestamp methods
247
+ * Bugfix: avoid a stack error when referring to an "attributes" attribute in initialize_with
248
+ * Removed: support for EOL versions of Ruby and Rails
249
+ * Removed: static attributes (use dynamic attributes with a block instead)
250
+ * Removed: looking up factories by class
251
+ * Removed: ignore method (use transient instead)
252
+ * Removed: duplicate_attribute_assignment_from_initialize_with configuration option
253
+ * Deprecated: allow_class_lookup configuration option
171
254
 
172
255
  ## 4.11.1 (September 7, 2018)
173
- * Documentation: Include .yardopts in the gem to fix broken RubyDoc links
256
+
257
+ * Documentation: Include .yardopts in the gem to fix broken RubyDoc links
174
258
 
175
259
  ## 4.11.0 (August, 15, 2018)
176
- * Bugfix: Do not raise error for valid build_stubbed methods: decrement, increment, and toggle
177
- * Bugfix: Do not add timestamps with build_stubbed for objects that shouldn't have timestamps
178
- * Deprecate static attributes
260
+
261
+ * Bugfix: Do not raise error for valid build_stubbed methods: decrement, increment, and toggle
262
+ * Bugfix: Do not add timestamps with build_stubbed for objects that shouldn't have timestamps
263
+ * Deprecate static attributes
179
264
 
180
265
  ## 4.10.0 (May 25, 2018)
181
- * Allow sequences to be rewound
266
+
267
+ * Allow sequences to be rewound
182
268
 
183
269
  ## 4.9.0 (skipped - FactoryGirl only release)
184
270
 
185
271
  ## 4.8.2 (October 20, 2017)
186
- * Rename factory_girl to factory_bot
272
+
273
+ * Rename factory_girl to factory_bot
187
274
 
188
275
  ## 4.8.1 (September 28, 2017)
189
- * Explicitly define `#destroyed?` within the `Stub` strategy to return `nil` instead of raising
190
- * Update various dependencies
191
- * Update internal test suite to use RSpec's mocking/stubbing instead of mocha
276
+
277
+ * Explicitly define `#destroyed?` within the `Stub` strategy to return `nil` instead of raising
278
+ * Update various dependencies
279
+ * Update internal test suite to use RSpec's mocking/stubbing instead of mocha
192
280
 
193
281
  ## 4.8.0 (December 16, 2016)
194
- * Improve documentation
195
- * Add `FactoryGirl.generate_list` to be consistent with `build_list`/`create_list` and friends
196
- * Add `FactoryGirl.use_parent_strategy` configuration to allow associations to leverage parent build strategy
282
+
283
+ * Improve documentation
284
+ * Add `FactoryGirl.generate_list` to be consistent with `build_list`/`create_list` and friends
285
+ * Add `FactoryGirl.use_parent_strategy` configuration to allow associations to leverage parent build strategy
197
286
 
198
287
  ## 4.7.0 (April 1, 2016)
199
- * Improve documentation
200
- * Improve instrumentation payload to include traits, overrides, and the factory itself
201
- * Allow linting of traits
202
- * Deprecate factory lookup by class name in preparation for 5.0
203
- * Improve internal performance by using flat_map instead of map and compact
204
- * Improve handling of dirty attributes after building a stubbed object
205
- * Reduce warnings from redefining methods
288
+
289
+ * Improve documentation
290
+ * Improve instrumentation payload to include traits, overrides, and the factory itself
291
+ * Allow linting of traits
292
+ * Deprecate factory lookup by class name in preparation for 5.0
293
+ * Improve internal performance by using flat_map instead of map and compact
294
+ * Improve handling of dirty attributes after building a stubbed object
295
+ * Reduce warnings from redefining methods
206
296
 
207
297
  ## 4.6.0 (skipped)
208
298
 
209
299
  ## 4.5.0 (October 17, 2014)
210
- * Improve FactoryGirl.lint by including exception and message in output
211
- * Allow selective linting
212
- * Use more explicit #public_send when doing attribute assignment
213
- * Improve documentation around FactoryGirl.lint and initialize_with
214
- * Deprecate #ignore in favor of #transient
300
+
301
+ * Improve FactoryGirl.lint by including exception and message in output
302
+ * Allow selective linting
303
+ * Use more explicit #public_send when doing attribute assignment
304
+ * Improve documentation around FactoryGirl.lint and initialize_with
305
+ * Deprecate #ignore in favor of #transient
215
306
 
216
307
  ## 4.4.0 (February 10, 2014)
217
- * Add FactoryGirl.lint
218
- * Fix memory leak in duplicate traits
219
- * Update documentation
308
+
309
+ * Add FactoryGirl.lint
310
+ * Fix memory leak in duplicate traits
311
+ * Update documentation
220
312
 
221
313
  ## 4.3.0 (November 3, 2013)
222
- * Start testing against Rails 4.0 and Ruby 2.0.0
223
- * Stop testing against Rails 3.0 and Ruby 1.9.2
224
- * Add `*_pair` methods to only build two objects
225
- * Raise if a method is defined with a FactoryGirl block (factory or trait)
226
- * Allow use of Symbol#to_proc in callbacks
227
- * Add global callbacks
228
- * Improve GETTING_STARTED and README
314
+
315
+ * Start testing against Rails 4.0 and Ruby 2.0.0
316
+ * Stop testing against Rails 3.0 and Ruby 1.9.2
317
+ * Add `*_pair` methods to only build two objects
318
+ * Raise if a method is defined with a FactoryGirl block (factory or trait)
319
+ * Allow use of Symbol#to_proc in callbacks
320
+ * Add global callbacks
321
+ * Improve GETTING_STARTED and README
229
322
 
230
323
  ## 4.2.0 (January 18, 2013)
231
- * Improve documentation
232
- * Allow `*_list` syntax methods to accept a block
233
- * Update gem dependencies
234
- * Allow setting id for objects created with `build_stubbed`
235
- * Fix Stub strategy to mimic ActiveRecord regarding `created_at`
236
- * Evaluate sequences within the context of an Evaluator
237
- * Fix Mocha deprecation warning
238
- * Fix some warnings when running RUBYOPT=-w rake
239
- * Convert test suite to RSpec's "expect" syntax
324
+
325
+ * Improve documentation
326
+ * Allow `*_list` syntax methods to accept a block
327
+ * Update gem dependencies
328
+ * Allow setting id for objects created with `build_stubbed`
329
+ * Fix Stub strategy to mimic ActiveRecord regarding `created_at`
330
+ * Evaluate sequences within the context of an Evaluator
331
+ * Fix Mocha deprecation warning
332
+ * Fix some warnings when running RUBYOPT=-w rake
333
+ * Convert test suite to RSpec's "expect" syntax
240
334
 
241
335
  ## 4.1.0 (September 11, 2012)
242
- * Allow multiple callbacks to bind to the same block
243
- * Fix documentation surrounding the stub strategy
336
+
337
+ * Allow multiple callbacks to bind to the same block
338
+ * Fix documentation surrounding the stub strategy
244
339
 
245
340
  ## 4.0.0 (August 3, 2012)
246
- * Remove deprecated cucumber_steps
247
- * Remove deprecated alternate syntaxes
248
- * Deprecate duplicate_attribute_assignment_from_initialize_with, which is now unused
249
- as attributes assigned within initialize_with are not subsequently assigned
341
+
342
+ * Remove deprecated cucumber_steps
343
+ * Remove deprecated alternate syntaxes
344
+ * Deprecate duplicate_attribute_assignment_from_initialize_with, which is now unused
345
+ as attributes assigned within initialize_with are not subsequently assigned
250
346
 
251
347
  ## 3.6.1 (August 2, 2012)
252
- Update README to include info about running with JRuby
253
- * Update dependencies on RSpec and tiny versions of Rails in Appraisal
254
- * Improve flexibility of using traits with associations and add documentation
255
- * Stub update_column to raise to mirror ActiveRecord's change from update_attribute
348
+
349
+ Update README to include info about running with JRuby
350
+ * Update dependencies on RSpec and tiny versions of Rails in Appraisal
351
+ * Improve flexibility of using traits with associations and add documentation
352
+ * Stub update_column to raise to mirror ActiveRecord's change from update_attribute
256
353
 
257
354
  ## 3.6.0 (July 27, 2012)
258
- * Code/spec cleanup
259
- * Allow factories with traits to be used in associations
260
- * Refactor Factory to use DefinitionHierarchy to handle managing callbacks,
261
- custom constructor, and custom to_create
262
- * Add memoization to speed up factories providing attribute overrides
263
- * Add initial support of JRuby when running in 1.9 mode
264
- * Improve docs on what happens when including FactoryGirl::Syntax::Methods
355
+
356
+ * Code/spec cleanup
357
+ * Allow factories with traits to be used in associations
358
+ * Refactor Factory to use DefinitionHierarchy to handle managing callbacks,
359
+ custom constructor, and custom to_create
360
+ * Add memoization to speed up factories providing attribute overrides
361
+ * Add initial support of JRuby when running in 1.9 mode
362
+ * Improve docs on what happens when including FactoryGirl::Syntax::Methods
265
363
 
266
364
  ## 3.5.0 (June 22, 2012)
267
- * Allow created_at to be set when using build_stubbed
268
- * Deprecate FactoryGirl step definitions
365
+
366
+ * Allow created_at to be set when using build_stubbed
367
+ * Deprecate FactoryGirl step definitions
269
368
 
270
369
  ## 3.4.2 (June 19, 2012)
271
- * Fix bug in traits with callbacks called implicitly in factories whose
272
- callbacks trigger multiple times
370
+
371
+ * Fix bug in traits with callbacks called implicitly in factories whose
372
+ callbacks trigger multiple times
273
373
 
274
374
  ## 3.4.1 (June 18, 2012)
275
- * Fix traits so they can be nested and referred to from other traits
375
+
376
+ * Fix traits so they can be nested and referred to from other traits
276
377
 
277
378
  ## 3.4.0 (June 11, 2012)
278
- * Sequences support Enumerators
279
- * Optionally disable duplicate assignment of attributes in initialize_with
280
- * Make hash of public attributes available in initialize_with
281
- * Support referring to a factory based on class name
379
+
380
+ * Sequences support Enumerators
381
+ * Optionally disable duplicate assignment of attributes in initialize_with
382
+ * Make hash of public attributes available in initialize_with
383
+ * Support referring to a factory based on class name
282
384
 
283
385
  ## 3.3.0 (May 13, 2012)
284
- * Allow to_create, skip_create, and initialize_with to be defined globally
285
- * Allow to_create, skip_create, and initialize_with to be defined within traits
286
- * Fix deprecation messages for alternate syntaxes (make, generate, etc.)
287
- * Improve library documentation
288
- * Deprecate after_build, after_create, before_create, after_stub in favor of new callbacks
289
- * Introduce new callback syntax: after(:build) {}, after(:custom) {}, or callback(:different) {}
290
- This allows for declaring any callback, usable with custom strategies
291
- * Add attributes_for_list and build_stubbed_list with the StrategySyntaxMethodRegistrar
292
- * Allow use of syntax methods (build, create, generate, etc) implicitly in callbacks
293
- * Internal refactoring of a handful of components
386
+
387
+ * Allow to_create, skip_create, and initialize_with to be defined globally
388
+ * Allow to_create, skip_create, and initialize_with to be defined within traits
389
+ * Fix deprecation messages for alternate syntaxes (make, generate, etc.)
390
+ * Improve library documentation
391
+ * Deprecate after_build, after_create, before_create, after_stub in favor of new callbacks
392
+ * Introduce new callback syntax: after(:build) {}, after(:custom) {}, or callback(:different) {}
393
+ This allows for declaring any callback, usable with custom strategies
394
+ * Add attributes_for_list and build_stubbed_list with the StrategySyntaxMethodRegistrar
395
+ * Allow use of syntax methods (build, create, generate, etc) implicitly in callbacks
396
+ * Internal refactoring of a handful of components
294
397
 
295
398
  ## 3.2.0 (April 24, 2012)
296
- * Use AS::Notifications for pub/sub to track running factories
297
- * Call new within initialize_with implicitly on the build class
298
- * Skip to_create with skip_create
299
- * Allow registration of custom strategies
300
- * Deprecate alternate syntaxes
301
- * Implicitly call factory_bot's syntax methods from dynamic attributes
399
+
400
+ * Use AS::Notifications for pub/sub to track running factories
401
+ * Call new within initialize_with implicitly on the build class
402
+ * Skip to_create with skip_create
403
+ * Allow registration of custom strategies
404
+ * Deprecate alternate syntaxes
405
+ * Implicitly call factory_bot's syntax methods from dynamic attributes
302
406
 
303
407
  ## 3.1.0 (April 6, 2012)
304
- * Sequences support aliases, which reference the same block
305
- * Update documentation
306
- * Add before_create callback
307
- * Support use of #attribute_names method to determine available attributes for steps
308
- * Use ActiveSupport::Deprecation for all deprecations
408
+
409
+ * Sequences support aliases, which reference the same block
410
+ * Update documentation
411
+ * Add before_create callback
412
+ * Support use of #attribute_names method to determine available attributes for steps
413
+ * Use ActiveSupport::Deprecation for all deprecations
309
414
 
310
415
  ## 3.0.0 (March 23, 2012)
311
- * Deprecate the vintage syntax
312
- * Remove Rails 2.x support
313
- * Remove Ruby 1.8 support
314
- * Remove deprecated features, including default_strategy, factory_name,
315
- :method for defining default strategy, ignore on individual attributes, and
316
- interacting with Factory the way you would FactoryGirl
416
+
417
+ * Deprecate the vintage syntax
418
+ * Remove Rails 2.x support
419
+ * Remove Ruby 1.8 support
420
+ * Remove deprecated features, including default_strategy, factory_name,
421
+ :method for defining default strategy, ignore on individual attributes, and
422
+ interacting with Factory the way you would FactoryGirl
317
423
 
318
424
  ## 2.6.4 (March 16, 2012)
319
- * Do not ignore names of transient attributes
320
- * Ensure attributes set on instance are calculated uniquely
425
+
426
+ * Do not ignore names of transient attributes
427
+ * Ensure attributes set on instance are calculated uniquely
321
428
 
322
429
  ## 2.6.3 (March 9, 2012)
323
- * Fix issue with traits not being present the first time a factory is accessed
324
- * Update available Cucumber step definitions to not require a trailing colon
325
- when building a table of attributes to instantiate records with
430
+
431
+ * Fix issue with traits not being present the first time a factory is accessed
432
+ * Update available Cucumber step definitions to not require a trailing colon
433
+ when building a table of attributes to instantiate records with
326
434
 
327
435
  ## 2.6.2 (March 9, 2012)
328
- * Allow factories to use all their ancestors' traits
329
- * Ignore bin dir generated by bundler
330
- * Namespace ::Factory as top-level to fix vintage syntax issue with
331
- Ruby 1.9.2-p3p18
436
+ * Allow factories to use all their ancestors' traits
437
+ * Ignore bin dir generated by bundler
438
+ * Namespace ::Factory as top-level to fix vintage syntax issue with
439
+ Ruby 1.9.2-p3p18
332
440
 
333
441
  ## 2.6.1 (March 2, 2012)
334
- * Use FactoryGirl.reload in specs
335
- * Clean up running named factories with a particular strategy with
336
- FactoryGirl::FactoryRunner
442
+
443
+ * Use FactoryGirl.reload in specs
444
+ * Clean up running named factories with a particular strategy with
445
+ FactoryGirl::FactoryRunner
337
446
 
338
447
  ## 2.6.0 (February 17, 2012)
339
- * Improve documentation of has_many associations in the GETTING_STARTED
340
- document
341
- * Deprecate :method in favor of :strategy when overriding an association's
342
- build strategy
448
+
449
+ * Improve documentation of has_many associations in the GETTING_STARTED
450
+ document
451
+ * Deprecate :method in favor of :strategy when overriding an association's
452
+ build strategy
343
453
 
344
454
  ## 2.5.2 (February 10, 2012)
345
- * Fix step definitions to use associations defined in parent factories
346
- * Add inline trait support to (build|create)_list
347
- * Update ActiveSupport dependency to >= 2.3.9, which introduced
348
- class_attribute
455
+
456
+ * Fix step definitions to use associations defined in parent factories
457
+ * Add inline trait support to (build|create)_list
458
+ * Update ActiveSupport dependency to >= 2.3.9, which introduced
459
+ class_attribute
349
460
 
350
461
  ## 2.5.1 (February 3, 2012)
351
- * Fix attribute evaluation when the attribute isn't defined in the factory but
352
- is a private method on Object
353
- * Update rubygems on Travis before running tests
354
- * Fix spec name
355
- * Update GETTING_STARTED with correct usage of build_stubbed
356
- * Update README with more info on initialize_with
357
- * Honor :parent on factory over block nesting
462
+
463
+ * Fix attribute evaluation when the attribute isn't defined in the factory but
464
+ is a private method on Object
465
+ * Update rubygems on Travis before running tests
466
+ * Fix spec name
467
+ * Update GETTING_STARTED with correct usage of build_stubbed
468
+ * Update README with more info on initialize_with
469
+ * Honor :parent on factory over block nesting
358
470
 
359
471
  ## 2.5.0 (January 20, 2012)
360
- * Revert 'Deprecate build_stubbed and attributes_for'
361
- * Implement initialize_with to allow overriding object instantiation
362
- * Ensure FG runs against Rails 3.2.0
472
+
473
+ * Revert 'Deprecate build_stubbed and attributes_for'
474
+ * Implement initialize_with to allow overriding object instantiation
475
+ * Ensure FG runs against Rails 3.2.0
363
476
 
364
477
  ## 2.4.2 (January 18, 2012)
365
- * Fix inline traits' interaction with defaults on the factory
478
+
479
+ * Fix inline traits' interaction with defaults on the factory
366
480
 
367
481
  ## 2.4.1 (January 17, 2012)
368
- * Deprecate build_stubbed and attributes_for
369
- * Fix inline traits
482
+
483
+ * Deprecate build_stubbed and attributes_for
484
+ * Fix inline traits
370
485
 
371
486
  ## 2.4.0 (January 13, 2012)
372
- * Refactor internals of FactoryGirl to use anonymous class on which attributes
373
- get defined
374
- * Explicitly require Ruby 1.8.7 or higher in gemspec
375
- * Fix documentation
376
- * Add Gemnasium status to documentation
377
- * Supplying a Class to a factory that overrides to_s no longer results in
378
- getting the wrong Class constructed
379
- * Be more agnostic about ORMs when using columns in FactoryGirl step
380
- definitions
381
- * Test against Active Record 3.2.0.rc2
382
- * Update GETTING_STARTED to use Ruby syntax highlighting
487
+
488
+ * Refactor internals of FactoryGirl to use anonymous class on which attributes
489
+ get defined
490
+ * Explicitly require Ruby 1.8.7 or higher in gemspec
491
+ * Fix documentation
492
+ * Add Gemnasium status to documentation
493
+ * Supplying a Class to a factory that overrides to_s no longer results in
494
+ getting the wrong Class constructed
495
+ * Be more agnostic about ORMs when using columns in FactoryGirl step
496
+ definitions
497
+ * Test against Active Record 3.2.0.rc2
498
+ * Update GETTING_STARTED to use Ruby syntax highlighting
383
499
 
384
500
  ## 2.3.2 (November 26, 2011)
385
- * Move logic of where instance.save! is set to Definition
386
- * Fix method name from aliases_for? to alias_for?
387
- * Refactor internal attribute handling to use an anonymous class instead of
388
- faking Ruby's variable resolution. This allows for more sane usage of
389
- attributes without having to manage sorting priority because attributes
390
- can turn themselves into procs, which are used with define_method on a
391
- class so attributes work correctly all the time.
501
+
502
+ * Move logic of where instance.save! is set to Definition
503
+ * Fix method name from aliases_for? to alias_for?
504
+ * Refactor internal attribute handling to use an anonymous class instead of
505
+ faking Ruby's variable resolution. This allows for more sane usage of
506
+ attributes without having to manage sorting priority because attributes
507
+ can turn themselves into procs, which are used with define_method on a
508
+ class so attributes work correctly all the time.
392
509
 
393
510
  ## 2.3.1 (November 23, 2011)
394
- * Remove internally-used associate method from all the FactoryGirl::Proxy subclasses
395
- * Move around requiring of files
396
- * Consolidate errors into factory_bot.rb
397
- * Refactor AttributeList to deal with priority only when iterating over
398
- attributes
399
- * Refactor internals of some of the Proxy subclasses
400
- * Ensure callbacks on traits are executed in the correct order
511
+
512
+ * Remove internally-used associate method from all the FactoryGirl::Proxy subclasses
513
+ * Move around requiring of files
514
+ * Consolidate errors into factory_bot.rb
515
+ * Refactor AttributeList to deal with priority only when iterating over
516
+ attributes
517
+ * Refactor internals of some of the Proxy subclasses
518
+ * Ensure callbacks on traits are executed in the correct order
401
519
 
402
520
  ## 2.3.0 (November 18, 2011)
403
- * Registries are named, resulting in better messages when factories, traits,
404
- or sequences cannot be found
405
- * Fix incorrect tests
406
- * Internals refactoring introducing FactoryGirl::NullFactory,
407
- FactoryGirl::Definition, and FactoryGirl::DeclarationList
408
- * Use ActiveSupport for Hash#except and its delegation capabilities
409
- * Fix usage of callbacks when added via implicit traits
410
- * Use Bundler tasks and clean up dependencies
411
- * Fix failing spec for big letters in factory name passed as symbol
412
- * Add ability for traits to be added dynamically when creating an instance via
413
- build, create, build_stubbed, or attributes_for
521
+
522
+ * Registries are named, resulting in better messages when factories, traits,
523
+ or sequences cannot be found
524
+ * Fix incorrect tests
525
+ * Internals refactoring introducing FactoryGirl::NullFactory,
526
+ FactoryGirl::Definition, and FactoryGirl::DeclarationList
527
+ * Use ActiveSupport for Hash#except and its delegation capabilities
528
+ * Fix usage of callbacks when added via implicit traits
529
+ * Use Bundler tasks and clean up dependencies
530
+ * Fix failing spec for big letters in factory name passed as symbol
531
+ * Add ability for traits to be added dynamically when creating an instance via
532
+ build, create, build_stubbed, or attributes_for
414
533
 
415
534
  ## 2.2.0 (October 14, 2011)
416
- * Clean up RSpec suite to not use 'should'
417
- * Use create_list in step definitions
418
- * Syntax methods that deal with ORM interaction (attributes_for, build, build_stubbed,
419
- and create) now accept a block that yields the result. This results in a
420
- more convenient way to interact with the result than using Object.tap.
421
- * Standardize deprecation warnings
422
- * Update transient attribute syntax to use blocks instead of calling ignore on
423
- each attribute declaration
424
- * Parents can be defined after children because factories are evaluated when
425
- they're used; this means breaking up factories across multiple files will
426
- behave as expected
427
- * Large internal refactoring, including changing access modifiers for a
428
- handful of methods for a more clearly defined API
535
+
536
+ * Clean up RSpec suite to not use 'should'
537
+ * Use create_list in step definitions
538
+ * Syntax methods that deal with ORM interaction (attributes_for, build, build_stubbed,
539
+ and create) now accept a block that yields the result. This results in a
540
+ more convenient way to interact with the result than using Object.tap.
541
+ * Standardize deprecation warnings
542
+ * Update transient attribute syntax to use blocks instead of calling ignore on
543
+ each attribute declaration
544
+ * Parents can be defined after children because factories are evaluated when
545
+ they're used; this means breaking up factories across multiple files will
546
+ behave as expected
547
+ * Large internal refactoring, including changing access modifiers for a
548
+ handful of methods for a more clearly defined API
429
549
 
430
550
  ## 2.1.2 (September 23, 2011)
431
- * Bugfix: Vintage syntax fixed after bug introduced in 2.1.1
432
- * Introduce dependency on activesupport to remove code from Factory class
551
+
552
+ * Bugfix: Vintage syntax fixed after bug introduced in 2.1.1
553
+ * Introduce dependency on activesupport to remove code from Factory class
433
554
 
434
555
  ## 2.1.1 (September 23, 2011) (yanked)
435
- * Bugfix: Parent object callbacks are run before child object callbacks
436
- * Declarations: allow overriding/modification of individual traits in child factories
437
- * Callbacks refactored to not be attributes
438
- * Updating documentation for formatting and clarity (incl. new specificity for cucumber)
556
+
557
+ * Bugfix: Parent object callbacks are run before child object callbacks
558
+ * Declarations: allow overriding/modification of individual traits in child factories
559
+ * Callbacks refactored to not be attributes
560
+ * Updating documentation for formatting and clarity (incl. new specificity for cucumber)
439
561
 
440
562
  ## 2.1.0 (September 02, 2011)
441
- * Bugfix: created_at now defined for stubbed models
442
- * Gemspec updated for use with Rails 3.1
443
- * Factories can now be modified post-definition (useful for overriding defaults from gems/plugins)
444
- * All factories can now be reloaded with Factory.reload
445
- * Add :method => build to factory associations to prevent saving of associated objects
446
- * Factories defined in {Rails.root}/factories are now loaded by default
447
- * Various documentation updates
563
+
564
+ * Bugfix: created_at now defined for stubbed models
565
+ * Gemspec updated for use with Rails 3.1
566
+ * Factories can now be modified post-definition (useful for overriding defaults from gems/plugins)
567
+ * All factories can now be reloaded with Factory.reload
568
+ * Add :method => build to factory associations to prevent saving of associated objects
569
+ * Factories defined in {Rails.root}/factories are now loaded by default
570
+ * Various documentation updates
448
571
 
449
572
  ## 1.1.4 (November 28, 2008)
450
- * Factory.build now uses Factory.create for associations of the built object
451
- * Factory definitions are now detected in subdirectories, such as
452
- factories/person_factory.rb (thanks to Josh Nichols)
453
- * Factory definitions are now loaded after the environment in a Rails project
454
- (fixes some issues with dependencies being loaded too early) (thanks to
455
- Josh Nichols)
456
- * Factory names ending in 's' no longer cause problems (thanks to Alex Sharp
457
- and Josh Owens)
573
+
574
+ * Factory.build now uses Factory.create for associations of the built object
575
+ * Factory definitions are now detected in subdirectories, such as
576
+ factories/person_factory.rb (thanks to Josh Nichols)
577
+ * Factory definitions are now loaded after the environment in a Rails project
578
+ (fixes some issues with dependencies being loaded too early) (thanks to
579
+ Josh Nichols)
580
+ * Factory names ending in 's' no longer cause problems (thanks to Alex Sharp
581
+ and Josh Owens)
458
582
 
459
583
  ## 1.1.3 (September 12, 2008)
460
- * Automatically pull in definitions from factories.rb, test/factories.rb, or
461
- spec/factories.rb
584
+
585
+ * Automatically pull in definitions from factories.rb, test/factories.rb, or
586
+ spec/factories.rb
587
+
462
588
  ## 1.1.2 (July 30, 2008)
463
- * Improved error handling for invalid and undefined factories/attributes
464
- * Improved handling of strings vs symbols vs classes
465
- * Added a prettier syntax for handling associations
466
- * Updated documentation and fixed compatibility with Rails 2.1
589
+
590
+ * Improved error handling for invalid and undefined factories/attributes
591
+ * Improved handling of strings vs symbols vs classes
592
+ * Added a prettier syntax for handling associations
593
+ * Updated documentation and fixed compatibility with Rails 2.1
467
594
 
468
595
  ## 1.1.1 (June 23, 2008)
469
- * The attribute "name" no longer requires using #add_attribute
596
+
597
+ * The attribute "name" no longer requires using #add_attribute
470
598
 
471
599
  ## 1.1.0 (June 03, 2008)
472
- * Added support for dependent attributes
473
- * Fixed the attributes_for build strategy to not build associations
474
- * Added support for sequences
600
+
601
+ * Added support for dependent attributes
602
+ * Fixed the attributes_for build strategy to not build associations
603
+ * Added support for sequences
475
604
 
476
605
  ## 1.0.0 (May 31, 2008)
477
- * First version
606
+
607
+ * First version