aselab / scala-activerecord

ActiveRecord-like ORM library for Scala

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to edit associated items in play forms

frankdavid opened this issue · comments

Say, I have a 1:1 relation between User and Car.

case class User(name: String) extends ActiveRecord {
    lazy val car = hasOne[Car]
}
case class Car(name: String) extends ActiveRecord {
    lazy val user = belongsTo[User]
}
// companion objects

And I have a form

val form = User.form

Now it would be nice if I could access the car through the form.

form("car[name]").value

In reflections.scala around line 155 in method FieldInfo#fieldInfo() the value of clazz parameter will be BelongToAssociation and the method throws notSupported exception, so this field wont be included in the class's field list.

Any news on this?

👍