For more PRO Tips and foundational knowledge: 🔗 https://www.rubycademy.com
Did you know that `toggle!` calls `update_attribute` under the hood, which skips ActiveRecord validations?
#rubyonrails #activerecord
Did you know that `toggle!` calls `update_attribute` under the hood, which skips ActiveRecord validations?
#rubyonrails #activerecord
With Rails 7.1+, you can do it right in the `locals:` pragma!
🔗 www.rubycademy.com
#rubyonrails
With Rails 7.1+, you can do it right in the `locals:` pragma!
🔗 www.rubycademy.com
#rubyonrails
Why? No regex engine, faster execution, cleaner intent.
#rubyonrails
Why? No regex engine, faster execution, cleaner intent.
#rubyonrails
Use the ternary operator instead! 🙏
#rubyonrails #ruby
Use the ternary operator instead! 🙏
#rubyonrails #ruby
You can combine it with a `handle_rate_limit` method + a `BusyController` to centralize how you respond to throttled requests.
Keeps things clean and makes it super easy to extend later.
#rubyonrails
You can combine it with a `handle_rate_limit` method + a `BusyController` to centralize how you respond to throttled requests.
Keeps things clean and makes it super easy to extend later.
#rubyonrails