The 7 most common reasons for having Flaky tests in Ruby on Rails

In this post I will share with you the 7 most common reasons for Flaky tests in Ruby on Rails, but before I start, let me define what a flaky test is to ensure that we are all on the same page. What are flaky tests? As a developer there is probably nothing more annoying […]

How to do migrations with confidence in Ruby on Rails

Modifying the database schema used to be one of the most complicated tasks a software developer had to do back in the day. Thankfully ActiveRecord migrations simplified this a lot. However, even with this great tool, you need to learn how to use it properly. If you do not, there are still some scenarios in […]

My strategy to add tests to an application if you are on a budget

In the Ruby community there is the convention of adding tests whenever you do some changes to the code base. This is really awesome. Unfortunately it is not the same in other communities. In my experience doing technical due diligences of start ups this is a common weak point I usually find. Finally I must […]

Learn how to use Background jobs in Ruby on Rails right

Background jobs featured

Rails is a web framework, but it does much more than only handling user facing web requests. There is also a background side of the framework: background jobs. Don’t believe me? Stay with me! In this post you will learn: What are Background jobs. When should you use Background jobs in a Rails project Best […]

Rails helpers: how to use them right

Rails helpers banner

Rails Helpers typically are a source of confusion for new and not that new Rails developers. One of the most common questions I get is… what kind of code should go into the app/helpers/ folder? In todays post you will learn how should you use helpers and you will see them in action with a […]

How to keep your data confidential with Active Record Encryption

One of the most relevant new features shipped with Rails 7 is Active Record Encryption. Active Record Encryption helps to preserve your application’s data confidentiality by adding reversible application-level encryption in a way that you can encrypt, decrypt and do searches on that data. Advantages of Active Record Encryption Active Record Encryption makes encryption transparent […]

Persisting encrypted passwords in Rails with has_secure_password

Persisting passwords in plain text does not seem to be a very good idea. If for any reason an attacker manages to get access to your database they would be able to see all your users’ passwords without any restriction, giving them the possibility to authenticate as your users… and as you know, despite of […]

Rack::Attack! Block and throttle abusive requests in Rails

Your application should be focused on serving productive traffic to your users. Unfortunately not all the traffic you get has good intentions. Sometimes you need to block and throttle malicious requests to your Rails app. In today’s post you will learn how you can easily protect your Ruby on Rails application from the bad guys. […]

Does Ruby have multiple inheritance?

Multiple inheritance in Ruby

Today’s post is an excerpt from a tutorial I am creating about Rails API development that I hope to have available soon. I hope you enjoy it and find it useful! Many times you might have heard about programming languages supporting multiple inheritance… but is Ruby one of them? Before I answer that question let […]

How to use ActiveRecord Explain in Ruby on Rails

In today’s post we will see a tool that can help you to bring your ActiveRecord queries to the next level in terms of performance. Quite surprisingly to me, after interviewing many Ruby on Rails developers I realized that many people do not know it even exists. Today we will talk about ActiveRecord’s explain command. […]