structure was something like:
type Tests struct {
gorm.Model
Name string
Status int64
CreatedBy int64
CompanyID int64
TestAccessList TestAccessList
}
type TestAccessList struct {
gorm.Model
AccessType int64
UsersID int64
TestsID int64
CompaniesID int64
}
While joining the tables, the data in the TestAccessList (nested as Tests.TestAccessList) was not getting loaded. Is there an issue with the association I created or something else? Could anybody help me out?
Did you follow correctly the docs? https://jinzhu.me/gorm/associations.html#has-one
Обсуждают сегодня