Hi and sorry in advance for my poor worded reply :)
What you are doing wrong, in my opinion, is that you are doing a isEmpty test
against an Option, that might be Some() or None but won't be empty so you need
to check in a different way if you have already, or not, a name in the database.
Disclaimer:
I used the Hello Slick 3 seed from Typesafe Activator so the User class it's slighty
different (
user.id is an Int and it's missing the active member, but it should be easy
to be changed to your needs). I've attached the source file used to make the tests
so you can check it aswell.
My version of the code is something like this:
I've changed the get to return Some(User) or None, then it's chained with the
save action so if the get is successful it returns a result of type User, otherwise
it returns an id. In the yield block I run a match to see if I got a new id (hence a
new user in the db) or an existing user so I can compose always return a User.
Regards,
Alessandro.