Fix error on Rails 4