fix "has_one => has_many => has_many" name generation

reworked patch from #125 (thanks to kevinrood) with added specs.

Specs should probably be refactored to something nicer, but it makes the case for the "has_one => has_many => has_many" situation. 
I also added a "has_one => has_many" case to show that it didn't break there yet.