Upgrade to latest version of rails 3.2.x
Upgrade to latest version of rails 4.0.x
Remove circular reference.