Fixed support of Rails 3.0.x

Same than #51 but rebased