Better support for rails2 and rails3