---
title: factory_bot 6.3.0
teaser: 'factory_bot 6.3.0 is out, with Ruby 3.2 support, better docs, and more hooks.

  '
tags: factory_bot,open source,news
author: Mike Burns
published_on: 2023-09-05
---

We are thrilled to announce the release of [factory_bot 6.30][fb630]!

The factory\_bot library is a tool for setting up Ruby objects as test data, and
has become a vital part of any test interacting with ActiveRecord.

The 6.3.0 release saw tons of internal improvements thanks to Andrii Konchyn,
Daniel Colson, Daniel Nolan, Stefanni Brasil, and Yudai Takada. Thank you to
each of them for the invisible work that keeps factory\_bot running!

On the docs side, you likely saw the work I put into [updating the docs][docs].
I'd like to shout out Berkan Ünal, Edmund Korley, Glauco Custódio, Jonas S,
Lawrence Chou, Mark Huk, Robert Fletcher, Sara Jackson, and Stefanni Brasil for
their improvements to the book, the README, and the release notes.
Documentation is a vital part of a library, and they deserve all the
recognition they can get for their help.

## Visible changes

This release contains three user-visible changes.

The `did_you_mean` gem ships with Ruby; it's what offers suggested method names
when you get a `NoMethodError`. The factory\_bot library makes use of it to
offer suggestions if the factory name is missing. In Ruby 3.2, the interface
for this library [changed][]; thankfully, Daniel Colson noticed and patched it.
This means factory\_bot will work on Ruby 3.2.

When creating objects from factories, you can use the stub strategy
(`build_stubbed`) to get a dummy object. This object quacks like an
ActiveRecord object. Benjamin Fleischer noticed that the `#destroyed?` method
returned `nil`, not `false`, whereas in ActiveRecord it returns [_only_][bool]
`true` or `false`. Thanks to Benjamin for fixing that in factory\_bot. This
means that factory\_bot is actually compatible with ActiveRecord.

And finally, Sean Doyle added a hook that triggers an ActiveSupport
notification whenever a factory definition is fully evaluated and ready to use:
`factory_bot.compile_factory`. He has plans to use this from the
factory\_bot\_rails gem, but it's also available to anyone for all your hook
needs.

[fb630]: https://github.com/thoughtbot/factory_bot/releases/tag/v6.3.0
[changed]: https://bugs.ruby-lang.org/issues/18564
[docs]: https://thoughtbot.com/blog/new-docs-for-factory_bot
[bool]: https://thoughtbot.com/blog/what-is-a-boolean
