Making gem compatible with Rails 4