ActiveRecord associations and URL shortener