I'm trying to make it so I can get a value from one model into the creation of another model. This is very simplified but gives the error I'm having with a model instance extending a squeryl model. In reality I'm doing some calculations specific to this model, but need a value from another model.
I'm getting an error doing all sorts of versions of this:
class Bar(
val bazId: String
val someValue: String
) extends db.BaseModel {
val foo: Foo = db.MyDb.foos.lookup(bazId).head
def this(
bazId: Baz
) = {
this (
Baz.id,
foo.someValue,
)
}
The error is:
not found: value foo
[error] foo.someValue,
^
I've tried having some kind of lookup in the Object/singleton, inside of the def this() (that gives a "Application does not take parameters" error), and other things but nothing is working. Seems so simple, but having no luck at all.