Make compatible with Rails 4.