package ngorm

import (
    "gorm.io/gen"
    "gorm.io/gen/field"
    "gorm.io/plugin/optimisticlock"
)

func ScopeVersionWhere(versionField field.Field, version optimisticlock.Version) func(gen.Dao) gen.Dao {
    return func(dao gen.Dao) gen.Dao {
        return dao.Where(versionField.Eq(version))
    }
}