Exemple #1
0
func validate(scope *gorm.Scope) {
	if _, ok := scope.Get("gorm:update_column"); !ok {
		if result, ok := scope.DB().Get(skipValidations); !(ok && result.(bool)) {
			scope.CallMethodWithErrorCheck("Validate")
		}
	}
}
Exemple #2
0
func validate(scope *gorm.Scope) {
	db := scope.DB()
	if _, ok := db.Get(settingKey); !ok {
		db.InstantSet(settingKey, map[string][]string{})
	}

	if result, ok := db.Get(skipValidations); !(ok && result.(bool)) {
		scope.CallMethodWithErrorCheck("Validate")
	}
}