playframework/Play20 — comment on commit f35fd305d98038ab0fe3f8076368ee7f8d90015b
File:  line 0
By sadache:

(User.instance ~ Permission.instance *).
map(_.groupBy(_._1).mapValues(_._2))

On Thu, Jan 5, 2012 at 11:13 PM, recalcitrant <
reply@reply.github.com
> wrote:

> Thanks for your time, now I need to be able to convert this to my desired
> instance as the map operation returns an anorm.~[A,B] object.
>
> I need to transform this:
>
> val withPermissions = User.single ~/ maybe(Permission.single *) ^^ {
> case user ~ perms => user.copy(permissions = Set() ++
> perms.getOrElse(Nil))
> }
>
> to this:
>
> val withLotteryAndPermissions = (User.instance ~ Permission.instance *).
> map(_.groupBy(_._1))
> // needs to be further investigated....
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/playframework/Play20/commit/f35fd305d98038ab0fe3f8076368ee7f8d90015b#commitcomment-841851
>

--
www.sadekdrobi.com
ʎdoɹʇuǝ