cartalyst/sentry — pull request #61 by mike182uk (2012-02-11 23:56:37+00:00)
Title: Remove from group not actually removing from group

when doing something like this in my app

````
$new_group = 1;

//remove all users groups, so can re-add selected groups
$users_groups = $user->groups();
foreach ($users_groups as $group) {
$user->remove_from_group($group['id']);
}

//add user into new group
$user->add_to_group($new_group);

````
user is in group 1 and 2. I want to just have the user in group 1 and no other group. in the logic i wouldn't necessarily know which groups the user is currently in, so makes sense to remove all groups from user and just add the ones i know the user needs to be in.

I was getting a sentry error telling me that the user was already in the group. The DB record had been deleted but the groups array in the user had not been updated so it still thought the user was in the group.

Looks like incorrect item was being unset.