I want to skip checking after creating the object. Take an example
a person has many companies, and a company has many people.
a person has many placements and placements belongs to a person a person can have only one active placement
There is one check in the placement model that checks if a person has an active place when saving.
@placement is active placement
@employment.placement = @person
if @placement.save
@person.placements << @placement
@company.placements << @placement
end
Now that the placement is saved for the first time, there is no problem saving it.
Now the problem arises when
@person.placements << @placement
Because the person already has active placement via @ placement.save.
@ person.placements <<@placement again saves @placement and validation corrects the validation error of the @placement object.
Is there any way that I do not miss this particular check, where I am in the ############# area of my code.
.