Clean up copied struct fields with type conversion
This commit is contained in:
		
							parent
							
								
									ba69820281
								
							
						
					
					
						commit
						e6895ad95e
					
				@ -129,7 +129,7 @@ func (sd SoftDeleteDeleteClause) ModifyStatement(stmt *Statement) {
 | 
			
		||||
		if _, ok := stmt.Clauses["WHERE"]; !stmt.DB.AllowGlobalUpdate && !ok {
 | 
			
		||||
			stmt.DB.AddError(ErrMissingWhereClause)
 | 
			
		||||
		} else {
 | 
			
		||||
			SoftDeleteQueryClause{Field: sd.Field}.ModifyStatement(stmt)
 | 
			
		||||
			SoftDeleteQueryClause(sd).ModifyStatement(stmt)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		stmt.AddClauseIfNotExists(clause.Update{})
 | 
			
		||||
 | 
			
		||||
@ -287,7 +287,7 @@ func (stmt *Statement) BuildCondition(query interface{}, args ...interface{}) []
 | 
			
		||||
				if where, ok := cs.Expression.(clause.Where); ok {
 | 
			
		||||
					if len(where.Exprs) == 1 {
 | 
			
		||||
						if orConds, ok := where.Exprs[0].(clause.OrConditions); ok {
 | 
			
		||||
							where.Exprs[0] = clause.AndConditions{Exprs: orConds.Exprs}
 | 
			
		||||
							where.Exprs[0] = clause.AndConditions(orConds)
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					conds = append(conds, clause.And(where.Exprs...))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user