Archive for Ruby

When I fell in love with git hooks

It actually wasn’t that long ago that I stumbled upon git hooks and let me tell you – I was instantly hooked (he he). Git has triggers that can kick off custom scripts to run before an action. These are especially useful to help you…

Continue reading →

Capistrano 3 – How to run a custom rake task on the server

Here is a little nice task to put in your /lib/capistrano/tasks folder. This will allow you to run any rake task on the server. Then just run it by doing:

Continue reading →

Awesome error handling in Rails

One thing developers always want is kick-ass error handling. Most frameworks have pretty poor support for this and you usually need to use a debugger to get to the bottom of a bug. However, with some help from a few nifty gem’s, you can get…

Continue reading →

FIX: Capistrano deploy fails after changing repository URL

We have moved some of our clients repositories from Github to Bitbucket but when we tried to deploy we got the following error: I tried making a clean-up but that didn’t work. The solution however is pretty straight forward. You just need to login to…

Continue reading →

acts-as-nested-set ArgumentError Fix

Sometimes you can get this weird error when using acts-as-nested-set: To fix this you just fire up the console and rebuild your model. Woop!

Continue reading →

My highlights from the new Rails 3.2.3

I’ve been reading up on the news in Rails 3.2 and here are the stuff I think is worth highlighting to remember Active record Fetch only the “name” column from the model. Fetch unique only Fetch first, or if it doesn’t exist, create it Other…

Continue reading →

Some notes on Sphinx & Thinking Sphinx

If you ever have developed search solutions for a web application you probably are familiar with the hazzle attached to it. There are lots of stuff to think about and performance is often an issue when dealing with large sets of data. One of the…

Continue reading →