Added working syntax to ignore field

Replaced non-working `gorm:"-"` syntax with `sql:"-"` to ignore a field in a struct
This commit is contained in:
Andy Ruland 2016-06-12 07:08:32 +04:00 committed by GitHub
parent a2291efe5b
commit 3836f5441e

View File

@ -21,7 +21,7 @@ type User struct {
ShippingAddress Address // One-To-One relationship (belongs to - use ShippingAddressID as foreign key)
ShippingAddressID int
IgnoreMe int `gorm:"-"` // Ignore this field
IgnoreMe int `sql:"-"` // Ignore this field
Languages []Language `gorm:"many2many:user_languages;"` // Many-To-Many relationship, 'user_languages' is join table
}