Fix to get working on Rails 4