Geoff Baskwill ec72a4cb6b Call Query callback chain when preloading many2many (#1622)
When using `Preload` on a `many2many` association, the
`Query` callback chain was not being called. This made
it difficult to write a plugin that could reliably get
called regardless of how objects were being queried.

Now `handleManyToManyPreload` will call the `Query`
callback chain for each object that is retrieved by
following the association.

Since the data has already been read by the
`handleManyToManyPreload` method, a new scope setting
called `gorm:skip_queryCallback` is set to `true` before
calling the callbacks. Callbacks can check for the
presence of this setting if they should not be run; the
default `queryCallback` is an example of this case.

Fixes jinzhu/gorm#1621.
2018-02-09 23:22:53 +08:00
2015-08-22 08:46:46 +08:00
2016-02-29 22:06:15 +08:00
2016-03-08 22:00:15 +08:00
2014-08-28 16:14:44 +08:00
2015-01-05 08:59:18 +08:00
2017-07-23 16:04:22 +08:00
2017-08-11 23:24:00 +08:00
2017-08-11 18:03:32 +08:00
2016-03-08 22:00:15 +08:00
2016-01-15 21:16:48 +08:00
2017-04-19 10:17:29 +08:00
2018-01-31 18:22:30 +08:00
2017-03-22 23:50:42 +08:00
2015-03-12 15:50:38 +08:00
2017-03-30 11:48:50 +09:00

GORM

The fantastic ORM library for Golang, aims to be developer friendly.

Join the chat at https://gitter.im/jinzhu/gorm go report card wercker status GoDoc

Overview

  • Full-Featured ORM (almost)
  • Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism)
  • Callbacks (Before/After Create/Save/Update/Delete/Find)
  • Preloading (eager loading)
  • Transactions
  • Composite Primary Key
  • SQL Builder
  • Auto Migrations
  • Logger
  • Extendable, write Plugins based on GORM callbacks
  • Every feature comes with tests
  • Developer Friendly

Getting Started

Upgrading To V1.0

Supporting the project

http://patreon.com/jinzhu

Author

jinzhu

Contributors

https://github.com/jinzhu/gorm/graphs/contributors

License

Released under the MIT License.

Description
The fantastic ORM library for Golang, aims to be developer friendly
Readme
Languages
Go 99.9%
Shell 0.1%