Skip to content

Commit

Permalink
Include model value when preloading many2many relations to enable row…
Browse files Browse the repository at this point in the history
… query callbacks
  • Loading branch information
jinzhu committed Jun 17, 2016
1 parent 18917d1 commit caa7926
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion callback_query_preload.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (scope *Scope) handleManyToManyPreload(field *Field, conditions []interface

// generate query with join table
newScope := scope.New(reflect.New(fieldType).Interface())
preloadDB = preloadDB.Table(newScope.TableName()).Select("*")
preloadDB = preloadDB.Table(newScope.TableName()).Model(newScope.Value).Select("*")
preloadDB = joinTableHandler.JoinWith(joinTableHandler, preloadDB, scope.Value)

// preload inline conditions
Expand Down

0 comments on commit caa7926

Please sign in to comment.