Add parent association and replaced ruby1.8 hash syntax with ruby1.9 hash syntax