compatibility with Rails 4