获取重载方法值[save]无法应用于(models.UserReset)
模特:
case class UserReset (
id: ObjectId = new ObjectId,
userId: ObjectId,
email : String,
key : String,
used : Boolean = false,
createDate: Date = new Date()
)
控制器:
//save reset info
val userResetVal = UserReset(userId = user.id, email = user.email, key = resetLink)
User.save(userResetVal)
不确定为什么?或者我应该在val userResetVal = UserReset(userId = user.id,email = user.email,key = resetLink)中包含Id,Used和createDate?
答案 0 :(得分:0)
您希望UserReset
成为User
的单独模型吗?在这种情况下,您还需要
object UserReset {
// define the corresponding table structure
// and methods including save
}
并致电
UserReset.save(userResetVal)