コード例 #1
0
ファイル: callbacks.go プロジェクト: 8legd/qor-qor
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")
		}
	}
}
コード例 #2
0
ファイル: callbacks.go プロジェクト: kennylixi/qor
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")
	}
}