Add #to_s method to rails version

Needed to work with edge rails