1. Change from each to each_value since we did not use key
2. drop assignment of value to sum in test
Merge pull request #9782 from vipulnsward/change_from_each_to_each_key_habtm

Change from each to each_value;drop assignment in habtm