Understanding Rails Callbacks & Common Pitfalls
Why you should be careful when using Callbacks in Rails and their hidden gotchas

Search for a command to run...
Articles tagged with #activerecord
Why you should be careful when using Callbacks in Rails and their hidden gotchas

Today we will look at a handy Rails tool called store_accessor. store_accessor can be used with PostgreSQL(hstore/jsonb), or MySQL (5.7+ json) to directly access your data without clogging your models. It also allows us to use dirty methods on these ...

I have been written quite a few migrations and reviewed quite a few of them at Anarock Tech. This is one of the most common mistakes I see developers making, it's simple but quite easy to overlook. Context Can you spot the issue with this simple migr...

In this post i'll go through how to write efficient queries for belongs_to associations. I primarly work with Rails so it will focus on that a bit but i'll share the SQL versions too so you can implement similarly everywhere. Example domain model Let...
