factory_bot 6.5.4 → 6.5.6

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