I have this code. The method returns a (User, Acl, Tree) tuple. Instead of accessing the data with _._1, _._2 etc I use match. Is there an easier(better) way then what I’m doing? Thanks
User.findUserJoinAclTree(3).map {
_ match {
case(user, acl, tree) =>
Logger.info(user.email)
Logger.info(acl.id)
Logger.info(tree.name)
}
}
Your expression can be simplified a bit:
First, you don’t need to match the arguments, you can directly pass a partial function to map, then you can use wildcard (_) for the the tuple elements you don’t need