The blog ofJonathan Pepin

Sandi Metz at Parisoma

2012-12-25

If you're a Ruby developer and you havn't read Sandi Metz's book POOTR, shame on you. If you havn't heard of her... well shame on you, but trust me, now you know her, you're life is already happier! Whomever you...

Rails Elevator of Migrations

2012-11-11

Migrations Elevator Psy http://images.wikia.com/mlp/images/4/40/Elevator.gif In rails, modifications on the Database are made through migrations. Migrations are sort of like git, for databases’ schema. Every time you want to modify your database, you create a new migration file, allowing you to revert...

Playing with Hash#sort

2012-09-11

Sorting a Hash I wanted to understand what happened under the hood when hash.sort is called; ruby hash.sort { |a, b| b[1] <=> a[1] } If you can't answer, you might want to read. *** First, let's begin...