Uncle Bob (Robert C Martin) said:

Date frameworks, but not to marry them.

Many Ruby/Rails developers married to Rails. This article will show how to start dating with Rails.

Hi there. When you work on a greenfield project everything goes well. But at some point each big project has this issue with DataBase performance. It get's not easy to make changes to DB structure, insert data. Queries are getting slower and slower. It's time to do something with it.

Today I would like to show you how easily spot a problem and improve performance of your app.

If you didn't hear about N+1 query problem you can read about it even on official Rails guides website.

We're so get used to nice features of ActiveRecord that we don't care about resulting SQL that being generated by ORM. We don't count how many queries we do and how complex they are.

Today's post will be more about Ruby On Rails and ActiveRecord. But first things first. If you didn't hear about Law of Demeter, I really recommend to read about it.

In general - it's a set of rules which bounds knowledge of modules about each other and allows you to reduce coupling of your system.

Here is how Wikipedia describes it: