import router from '@adonisjs/core/services/router'
import User from '#models/user'
import { DateTime } from 'luxon'
router.get('/', async () => {
const user = await User.create({})
console.log(user.userId) // ✅ valid
// trying to update any attribute fails
user.createdAt = DateTime.now()
await user.save() // 🚫 fails to update, as it's checking for `user.user_id` instead of `user.userId`
})
Package version
21.3.0
Describe the bug
TL:DR;
selfAssignPrimaryKey
doesn't take into consideration of the naming strategy when finding the primary key valueDescription
Reproduction repo
https://github.com/radiumrasheed/lucid-issue-1