What is the Groovy way to get collection items without items in subcollection. For example:
collection: [1,2,3,4,5,6]
subcollection: [1,5,6]
the result should be: [2,3,4]
EDIT: It looks I'm doing something wrong. This is part of my code:
def report = Report.get(params.report.id)
def user = User.get(params.user.id)
List<User> availableUsers = []
availableUsers = User.findAllByCompany(company))
List<User> addedUsers = []
addedUsers = (List<User>) session["addedUsers"] ?: []
addedUsers << user
session["addedUsers"] = null
session["addedUsers"] = addedUsers
availableUsers = availableUsers - addedUsers
This code is only removing last user in addedUsers list.
availableUsers: [John, Jack, Jim]
addedUsers: [John, Jack]
availableUsers - addedUsers: [John, Jim]
Every time only the last item in addedUsers gets removed. I'm guessing I'm missing something obvious but I cant find it.