Generating pledge model and adding associations