Make it work on Rails 4