Call after initialize for gorm.Config
This commit is contained in:
		
							parent
							
								
									2f4925e017
								
							
						
					
					
						commit
						f36bf7c735
					
				
							
								
								
									
										8
									
								
								gorm.go
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								gorm.go
									
									
									
									
									
								
							| @ -137,6 +137,14 @@ func Open(dialector Dialector, opts ...Option) (db *DB, err error) { | |||||||
| 		return isConfig && !isConfig2 | 		return isConfig && !isConfig2 | ||||||
| 	}) | 	}) | ||||||
| 
 | 
 | ||||||
|  | 	if len(opts) > 0 { | ||||||
|  | 		if c, ok := opts[0].(*Config); ok { | ||||||
|  | 			config = c | ||||||
|  | 		} else { | ||||||
|  | 			opts = append([]Option{config}, opts...) | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	var skipAfterInitialize bool | 	var skipAfterInitialize bool | ||||||
| 	for _, opt := range opts { | 	for _, opt := range opts { | ||||||
| 		if opt != nil { | 		if opt != nil { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinzhu
						Jinzhu