Made it compatible with Rails 4.0