N+1 queries basics Free
Just enough fundamentals to be fluent preloading associations with ActiveRecord, and start helping your team to avoid n+1 queries on production.
Read moreJust enough fundamentals to be fluent preloading associations with ActiveRecord, and start helping your team to avoid n+1 queries on production.
Read moreMaster n+1 queries identification, preloading, counts and counter caches, and eliminate n+1 queries from your code.
Read moreIf you want to add images to a record but you don’t want to use a JavaScript plugin or write any custom JavaScript, you can use a regular file field, Active Storage, and vanilla Rails.
If you want to add many attachments to a record using just a file field, but you don’t want to remove the previous images from the record on every update, like in the following code:
When saving computed values in the database in your rails app, you must be aware that is possible to find unexpected errors in the result thanks to race conditions.
I have already shared an exercise to help you get more sensitivity about when an implementation...
Read moreWhen saving computed values in the database in your rails app, you must be aware that is possible to find unexpected errors in the result thanks to race conditions.
I have already shared an exercise to help you get more sensitivity about when an implementation...
Read moreWhen saving computed values in the database in your rails app, you must be aware that is possible to find unexpected errors in the result thanks to race conditions.
I have already shared an exercise to help you get more sensitivity about when an implementation...
Read moreWhen saving computed values in the database in your rails app, you must be aware that is possible to find unexpected errors in the result due to race conditions.
I have already shared an exercise to help you get more sensitivity about when an implementation...
Read moreI have already written about how you should be aware about race conditions when saving a computed value, because you could save a wrong value.
Here I want to share with you an exercise to help you (and me 😅) get more sensitivity about when an implementation...
Read moreWhen saving computed values in the database in your rails app, you must be aware that is possible to find unexpected errors in the result thanks to race conditions.
Here I want to help you visualize how race conditions can make you save incorrect...
Read moreIn Rails, sometimes you will need to save counts or custom computed values, where the default counter cache will not be enough.
Maybe you want to…
Imagine that you are creating a record (let’s say a tweet), and on creation, you want to add the tweet to the page and also update the tweets count in the page…
But you want to update the content, not just for the current user, but for all the users...
Read more