add get_groups_by_user_id method to groups model.