April 26, 2023

Why RSpec executes after_commit callbacks even with use_transactional_fixtures

I used to believe that after_commit callbacks are not executed within RSpec tests when config.use_transactional_fixtures is set to true. Well, I was wrong. Here's why.

Read more
February 11, 2023

ActiveRecord: finally understand transactions

Database transactions are an essential tool to master. Because ActiveRecord's transactions behavior is not intuitive (especially when it comes to nested transactions), this article explains how to use them and what pitfalls you should pay attention to.

Read more
November 19, 2021

ActiveRecord: finally understand joins and left_outer_joins

If you never really understood how joins work, or if you're somewhat familiar with .joins but hardly grasp what .left_outer_joins does, this is the blog post you need.

Read more
November 15, 2021

How to add SSL to Ruby on Rails on localhost

It is not common to run a Rails application in development mode locally over SSL. This article explains how to do that.

Read more
October 25, 2021

How to have UUID primary keys with PostgreSQL

Step-by-step tutorial on how to enable and use UUID primary keys in your Rails application

Read more
July 26, 2021

How to hack with ransack

ransack is a 4.9k star gem that provides out-of-the-box search tools for your Ruby on Rails application. Let's find out how it can be hijacked to hack an app and extract data or steal users accounts.

Read more