How to check if the object was already been saved to database ( e.g. by matching its id)?
Something similar to the following snippet:
case class User(id: Pk[Long], name:String) {
def loaded = id match {
case NotAssigned => false
case Pk(refererId) => true
}
}
In this example, you want: