Pass nil instead of "" into joins when not joining

This fixes an issue against Active Record 4.0, which interprets an
empty string as an association with the name "".