Database Migration Tips in Rails - Part 1

Database migrations are an everyday task and as such are not generally considered as exciting as software architecture or any other hot topic in the industry. Yet, they are essential in any applications that use databases! Ruby on Rails handles a lot of problems with migrations for us. However, there are still some details everyone must remember to avoid troubles. That’s why I would like to share with you some simple tips on how to improve your database migrations, which hopefully, you will find very useful and powerful!...

November 10, 2022 · 7 min · Milosz Jarmula

Don't fear local variables 😱

Local variables are one of the basic building blocks in programming in general. In Ruby, it is the only variable that doesn’t start with special characters like @, @@, or $, which indicates that they should be used often. However, many Rubyists, including me a couple of months ago, tend to avoid them in favor of message chains, passing expressions directly to the caller, or by using the extract_method pattern...

January 13, 2022 · 3 min · Milosz Jarmula