Skip to content

Commit

Permalink
fix: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
toopay committed Oct 2, 2024
1 parent cbb1b33 commit b9574df
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/db/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ func (q *Query) Preload(table string, args ...string) *Query {

relations := strings.Split(table, ".")

fmt.Printf("Preloading table: %s, field: %s, operator: %s, value: %s\n", table, field, operator, value)

if len(relations) > 3 {
raiden.Fatal("unsupported nested relations more than 3 levels")
}
Expand All @@ -53,7 +51,6 @@ func (q *Query) Preload(table string, args ...string) *Query {
raiden.Fatal("could not find related model.")

Check warning on line 51 in pkg/db/relation.go

View check run for this annotation

Codecov / codecov/patch

pkg/db/relation.go#L51

Added line #L51 was not covered by tests
}

fmt.Printf("Related model: %v\n", relatedModel)
relatedModelStruct := reflect.TypeOf(relatedModel)
if relatedModelStruct.Kind() == reflect.Ptr {
relatedModelStruct = relatedModelStruct.Elem()

Check warning on line 56 in pkg/db/relation.go

View check run for this annotation

Codecov / codecov/patch

pkg/db/relation.go#L56

Added line #L56 was not covered by tests
Expand Down Expand Up @@ -127,9 +124,6 @@ func (q *Query) Preload(table string, args ...string) *Query {
}
}

fmt.Println("Relations: ", relationMap)
fmt.Println("Selects: ", selects)
fmt.Println("Prefix: ", relatedFieldPrefix)
q.Relations = append(q.Relations, selects...)

if field != "" && operator != "" && value != "" {
Expand Down

0 comments on commit b9574df

Please sign in to comment.