Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for visitZip (0.08 sec)

  1. callbacks/helper.go

    			}
    		}
    		if !withCondition {
    			db.AddError(gorm.ErrMissingWhereClause)
    		}
    		return
    	}
    }
    
    type visitMap = map[reflect.Value]bool
    
    // Check if circular values, return true if loaded
    func loadOrStoreVisitMap(visitMap *visitMap, v reflect.Value) (loaded bool) {
    	if v.Kind() == reflect.Ptr {
    		v = v.Elem()
    	}
    
    	switch v.Kind() {
    	case reflect.Slice, reflect.Array:
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Apr 14 12:32:57 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  2. callbacks/helper_test.go

    	"reflect"
    	"testing"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    )
    
    func TestLoadOrStoreVisitMap(t *testing.T) {
    	var vm visitMap
    	var loaded bool
    	type testM struct {
    		Name string
    	}
    
    	t1 := testM{Name: "t1"}
    	t2 := testM{Name: "t2"}
    	t3 := testM{Name: "t3"}
    
    	vm = make(visitMap)
    	if loaded = loadOrStoreVisitMap(&vm, reflect.ValueOf(&t1)); loaded {
    		t.Fatalf("loaded should be false")
    	}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Mar 05 02:22:57 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  3. callbacks/associations.go

    func checkAssociationsSaved(db *gorm.DB, values reflect.Value) bool {
    	if visit, ok := db.Get(visitMapStoreKey); ok {
    		if v, ok := visit.(*visitMap); ok {
    			if loadOrStoreVisitMap(v, values) {
    				return true
    			}
    		}
    	} else {
    		vistMap := make(visitMap)
    		loadOrStoreVisitMap(&vistMap, values)
    		db.Set(visitMapStoreKey, &vistMap)
    	}
    
    	return false
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Apr 11 03:06:13 UTC 2023
    - 14.3K bytes
    - Viewed (0)
Back to top