Rails 4: ActiveModel::Name is not a String anymore.

This changes can be applied directly to `master`. I can make a pull request for this also.