I have a folowing relationship: Gallery model, which has all the gallery information and GalleryImage model, which has images from the Gallery. GalleryImage has:
$this->belongsTo('galleryId', 'Gallery', 'id', ['alias' => 'gallery']);
Gallery has it's own
validation() method used which makes sure user can't create a gallery without a name and that the gallery's slug (URL) is unique.
GalleryImage has no validation method as there are no model-level validations required.
However, for some reason when I trigger
save() in the GalleryImage model, the validation in Gallery model is executed and fails with an error saying that "Slug is not unique".
How can this happen? I'm using Phalcon 3.1.0.