Fix compatibility with Rails 3

fixes #5
Release version 0.3.1

Add compatibility with Rails 3