Porting https://github.com/jamiew/blackbook to Rails 4.2