---
title: 'This week in #dev (Feb 21, 2025)'
teaser: 'Highlights of what happened in our #dev channel on Slack this week.

  '
tags: this week in dev,ruby,tip,testing
author: thoughtbot
published_on: 2025-03-07
---

Welcome to another edition of [This Week in #dev](https://thoughtbot.com/blog/tags/this-week-in-dev),
a series of posts where we bring some of our most interesting Slack
conversations to the public.

## URL-Safe serialization for any Ruby object

[Matheus Richard][matheus] shares a gem called [Universal
ID](https://github.com/hopsoft/universalid) that can serialize any Ruby object
into a URL-safe string. This is a generalization of [Rails' Global ID].

```rb
uri = URI::UID.build(:demo).to_s
#=> "uid://universalid/iwKA1gBkZW1vAw#CwWAkccHf6ZTeW1ib2wD"
```

[matheus]: https://thoughtbot.com/blog/authors/matheus-richard
[Rails' Global ID]: https://github.com/rails/globalid

## Configuring Rails Generators to Use FactoryBot with Minitest

[Louis Antonopoulos][louis261] provides guidance for Minitest users on
configuring Rails' generators to use [FactoryBot] instead of fixtures.

To set up:

- Add `gem "minitest-rails", "~> 8.0.0"` to the `:test` group in your Gemfile,
  matching your Rails version.
- Update `config/application.rb` with:

```ruby
# Use FactoryBot instead of fixtures when using Rails generators
config.generators do |g|
  g.test_framework :minitest, spec: false, fixture: false
  g.fixture_replacement :factory_bot, dir: "test/factories"
end
```

Running `rails g model tomato` will now:

- Add a `:tomato` factory to `test/factories.rb`
- Avoid generating `test/fixtures/tomatoes.yml`

[louis261]: https://thoughtbot.com/blog/authors/louis-antonopoulos
[FactoryBot]: https://github.com/thoughtbot/factory_bot

## Thanks

This edition was brought to you by [Louis Antonopoulos][louis261] and [Matheus Richard][matheus]. Thanks to all contributors! 🎉
