Make it work with rails 4(first aid, should make it compatible with rails 3 too later)