Revert "Revert "Fix hash index""

This reverts commit 00af9aa9e76734ba3b5667b482737a3d4c0fc615.
Revert "Updated rails"

This reverts commit 4c4d18c88d179cb27ba00dfc0d92c660b82b85a8.