Skip to content

Commit

Permalink
chore: fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
luantranminh committed Jun 1, 2024
1 parent 0f93284 commit 22dc078
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gormschema/gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (l *Loader) Load(models ...any) (string, error) {
if err = cm.setupJoinTables(tables...); err != nil {
return "", err
}
orderedTables, err := cm.orderModels(tables)
orderedTables, err := cm.orderModels(tables...)
if err != nil {
return "", err
}
Expand Down Expand Up @@ -313,7 +313,7 @@ func BuildStmt(fn func(db *gorm.DB) *gorm.DB) ViewOption {

// orderModels places join tables at the end of the list of models (if any),
// which helps GORM resolve m2m relationships correctly.
func (m *migrator) orderModels(models []any) ([]any, error) {
func (m *migrator) orderModels(models ...any) ([]any, error) {
var (
joinTableDBNames = make(map[string]bool)
otherTables []any
Expand Down

0 comments on commit 22dc078

Please sign in to comment.