GORM .Save don't save "has one" relation to the database
I have struct: type Book struct { gorm.Model Title string `json:"title"` Author string `json:"author"` Description string `json:"description"` Category string `json:"Category"` Publisher string `json:"publisher"` AuthorsCard AuthorsCard `gorm:"foreignKey:BookID" json:"authorscard"` } type AuthorsCard struct { //gorm.Model // I purposely Don't want to use gorm.model ID uint `gorm:"primarykey"` BookID uint Name string `json:"name"` Age int `json:"age"` YearOfBirth int `json:"year"` Biography string `json:"biography"` } And I'm trying to make update function: // controller.go func UpdateBook(ctx *gin.Context) { enableCors(&ctx.Writer) id := ctx.Param("ID") var updateBook = &models.Book{} ...