Written by Jiří Pospíšil, a full stack developer currently working primarily with Ruby on Rails and Ember.js.

You can get in touch with me at mekishizufu@gmail.com

The definitive guide to Arel, the SQL manager for Ruby

Published on Jun 16, 2014

Arel is the kind of library that many of us Rails developers use on a daily basis and might not even know about it. So what’s this library whose name only pops up when everything else fails all about?

It’s all about providing frameworks with a way of building and representing SQL queries. It’s not the kind of library you would typically want to use directly (although you could as shown in a minute). Arel is meant to be the basic building block upon which frameworks build their own APIs that are more suitable for the end user.

One of those frameworks is ActiveRecord (AR), the default ORM in Rails. ActiveRecord’s responsibility is to provide a connection to the database, a convenient way to specify relationships between your models, provide a nice query interface and all the other things we enjoy.

Read more…

Replacing Make with Ninja

Published on Mar 16, 2014

Make and all of its flavours have been here for almost 40 years and it’s a tool hard to beat for many things. There are however cases when you do not need the power of Make and are willing to trade the flexibility for something else. In case of Ninja, for its speed.

Speed is the main motivation behind Ninja and its decisions how to write your build files. Ninja was written by Evan Martin specifically to fight slow build cycles while working on Google Chrome.

The bigger the project, the longer it takes to figure out what files need to be recompiled or if any action is required at all. As a result of numerous optimizations, Ninja is much faster when compared to alternatives. Ninja’s secret is to do the least amount of work possible and let other more high level tools to handle the rest upfront.

Read more…