we add begin/rescue block to prevent data insertion to the DB when the mandatory fields are not present in the log file. We also added dependent option to the Campaign model so that, when parent model will be deleted, there is no associated child objects in the DB.