forked from mirror/gorm
Fix Pluck's usage #4473
This commit is contained in:
parent
8e67a08774
commit
8bd8d38fe9
|
@ -474,7 +474,7 @@ func (db *DB) Scan(dest interface{}) (tx *DB) {
|
||||||
|
|
||||||
// Pluck used to query single column from a model as a map
|
// Pluck used to query single column from a model as a map
|
||||||
// var ages []int64
|
// var ages []int64
|
||||||
// db.Find(&users).Pluck("age", &ages)
|
// db.Model(&users).Pluck("age", &ages)
|
||||||
func (db *DB) Pluck(column string, dest interface{}) (tx *DB) {
|
func (db *DB) Pluck(column string, dest interface{}) (tx *DB) {
|
||||||
tx = db.getInstance()
|
tx = db.getInstance()
|
||||||
if tx.Statement.Model != nil {
|
if tx.Statement.Model != nil {
|
||||||
|
|
Loading…
Reference in New Issue