Matheus Richard

@matheusrich
48 Followers
62 Following
107 Posts

🇧🇷 Senior developer @ thoughtbot.

📝 Blogging @ https://tbot.io/blog/matheus

💎 Organizer of http://rubydf.com

Nice addition in Rails: now when validates_uniqueness_of fails, you'll be able to access the ID of the record that caused the conflict
https://github.com/rails/rails/pull/55826
Add conflicting record ID to `validates_uniqueness_of` error details by bvicenzo · Pull Request #55826 · rails/rails

Motivation and Background Currently, when a validates_uniqueness_of validation fails, the errors.details hash only provides { error: :taken, ... }. This indicates that a conflict exists but offers ...

GitHub
Just deleted ~1.6k LOC and ~770 KB of JS by replacing a chart library (and all of its deps) with a Ruby helper that renders the charts as plain HTML/CSS. CSS Anchor Positioning made this basically JS-free.

Inspired by @nateberkopec, I wrote about why and how you should enable MFA for your gems!

If you don't have any gems, this can be one of the easiest open-source contributions you can make! Check it out:

https://thoughtbot.com/blog/lets-enable-mfa-for-all-ruby-gems

Let's enable MFA for all Ruby gems

Supply chain attacks are getting more common. RubyGems might be next. Here’s how to help the ecosystem be safer.

thoughtbot

No one sets out to write a slow test, and yet it happens. Prevent slow tests from creeping into your test suite again! Tests are not enough, we need *fast* tests!

https://thoughtbot.com/blog/introducing-test-budget

Introducing Test Budget: a linter for test performance

Your test suite didn’t get slow all at once. It won’t get fast all at once either. Start by making sure it stops getting worse.

thoughtbot
Also, stay tuned because I'll release a tool to prevent your tests from silently becoming slow again!

Here's one of those things that are easy to miss on code review and will make your tests super slow. Good news: it's easy to fix!

https://thoughtbot.com/blog/combine-capybara-selectors-to-avoid-the-sequential-timeout-trap

Combine Capybara selectors to avoid the sequential timeout trap

How I shaved over a minute off a test suite with a one-line change.

thoughtbot
Today I learned about Rails' Time.days_in_month and Time.days_in_year. So handy!

🎉 end_of_life 1.0.0.alpha is released! It includes:

- Macos install via homebrew
- Support for scanning EOL Node.js versions
- Support for detecting versions from `mise.toml`.
- A new `check` command to check if specific product releases are EOL
- A revamped CLI

Stay updated!

TIL about Git LFS: An open source Git extension for versioning large files

https://git-lfs.com/

Git Large File Storage

Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.

Git Large File Storage