🚨 Rails 8 Breaking Change
`stringify_keys` now stringifies all keys, not just symbols! 😮
This could break things silently if you’re not careful.
#rubyonrails#activesupport
✨Don't Overcomplicate Refactoring ✨
Simple reflexes can boost code readability!
➡️ Store roles and permissions in a hash for lookups
➡️ Use with_indifferent_access for string/symbol keys
➡️ Use Hash#fetch for lookups and error handling
#rubyonrails
Did you know you can implement a complete Configuration pattern with `ActiveSupport::Configurable`? 🤩
We also use the `configure` macro to set default values elegantly.
#rubyonrails
No more slow bundle installs! 🤯
Use the `MAKE` environment variable and the `nproc` command to dramatically speed up your `bundle install`!
#rubyonrails
In Rails 8, you can now access your notes directly in the browser by visiting `GET /rails/info/notes`!
Small details like this are why we love @rails! 💚
#rubyonrails
I love this lesser-known technique for checking if two arrays contain the same elements, regardless of order. 🤩
⚠️: `to_set` is cool but may slow down huge datasets! 😉
#rubyonrails
The Builder-to-Proc pattern is among my top 3 favorites! 💚
By defining `to_proc` on `self`, you can pass a class directly to `map`, and Ruby converts it into a builder for each element! 🤩
#rubyonrails
Did you know about `up_only` in ActiveRecord::Migration?
It lets you run code only when migrating up. 🤩
A simple but powerful method that deserves more attention.
#rubyonrails
Rails 8 introduced `rate_limit` for controllers.
You can combine it with a `handle_rate_limit` method and a `BusyController` to centralize how you respond to throttled requests.
And that's how Rails turns a messy problem into a simple solution. 💚
#rubyonrails