Updating for rails4 distinct

@whastings made a few small changes to the url_shortener solution. would you mind looking it over and merging it in if you're good with it?

basically the old way of doing
association_name.count(:user_id, distinct: true) # is deprecated

also 
has_many :association_names, distinct: true # is also deprecated

so I've written a couple specs and tried to update all this stuff to reflect.