Entity#persisted? should not go by id presence
Closed this issue · 2 comments
henrik commented
There are use cases for assigning an id to an unpersisted entity.
Currently, Minimapper entities have a persisted?
that just checks for an id, which will lie if you assign an id to an unpersisted entity.
Instead, it could be the mapper's responsibility to do something like entity.persisted = true
whenever you pull from the DB, save successfully etc.
henrik commented
See commit. How about it? Can make a pull request if you'd like.
henrik commented
This commit is relevant also: barsoom@cb4b63d