Port to Rails 4