Inheritance with companion Objects
<p>I am trying to refactor some models I have that currently look like this:</p>

<pre><code>case class Person(name: String, age: Int)

object Person {
    implicit val reads: Reads[Person] = (
        (JsPath \ "name").read[String] and
        (JsPath \ "age").read[Int] 
    )(Person.apply _)
}
</code></pre>

<p>To something that looks like this:</p>

<pre><code>abstract class BaseModel {
    val pk: String  // Some stuff here that will be common
}

object BaseModel {
    implicit val reads: Reads[BaseModel] // Not sure what to do here
}
</code></pre>

<p>So that I can do this:</p>

<pre><code>trait MyTrait[Model &lt;: BaseModel] {

    // More code here
    val body: JsObject = ...
    val parsed = body.validate[Model]  // Error: There is no implicit value defined for Model

}


case class NewPerson extends BaseModel {...}
object NewPerson {...} // Maybe need to extend something here


class MyController extends MyTrait[NewPerson]
</code></pre>

<hr>

<p>I want every model to define an implicit reads value, but I am unsure about how to indicate this in the abstract class's companion object.</p>