November 23, 2018

ActiveRecord on a Leash

Rails’ ActiveRecord gives you great power and as we all know with such comes great responsibility. Just inheriting from ApplicationRecord unlocks a huge interface at your disposal and it is very easy to fell into a trap and find yourself using it from everywhere in your application - controllers, views and other models. Over the years I found there is one simple rule that helps me keep it all under control. Read more

Powered by Hugo & Kiss.