<commit_before>Meteor.methods({
    GETBoard: function(boardId) {
        var board = Boards.findOne({id:boardId});
        // if board has been activated do nothing
        if(board.active)
            return;
        // remove old data
        Lanes.remove({board:boardId});
        Cards.remove({board:boardId});
        Buckets.remove({board:boardId});
        Milestones.remove({board:boardId});
        var users_url = HOST+API+'users/';
        var board_url = HOST+API+'boards/'+boardId+'/';
        var lanes_url = board_url+'lanes/';
        var cards_url = board_url+'cards/?archived=false';
        var buckets_url = board_url+'buckets/';
        var milestones_url = board_url+'milestones/';
        sortToCollection(lanes_url,Lanes);
        sortToCollection(cards_url,Cards);
        getToCollection(buckets_url,Buckets);
        getToCollection(milestones_url,Milestones);
        // get assignees and checklists for each card in board
        var cards = Cards.find({board:boardId});
        // keep track of the highest cardNumber for making new cards
        var nextCardNumber=0;
        cards.forEach(function (card) {
            var cardNumber = card.header.cardNumber;
            if( cardNumber > nextCardNumber) {
                nextCardNumber=cardNumber;
            }
            var checklist_url = HOST+API+'card/'+card.id+'/checklists/';
            var assignees_url = HOST+API+'card/'+card.id+'/assignees/';
            Assignees.remove({card:card.id});
            Checklists.remove({card:card.id});
            getToCollection(checklist_url,Checklists);
            getToCollection(assignees_url,Assignees);
            checkListItems = Checklists.find({})
            checkListItems.forEach( function(checkListItem) {
                var ticked = Meteor.call('getEventTicked', checkListItem.id);
                Checklists.update(checkListItem, {'$set' : {'checked' : ticked }})
            });
        });
        // set board to active and update nextCardNumber
        Boards.update(board,{ 
            '$set': {'active':true},
            '$set': {'nextCardNumber':nextCardNumber}
        });
    }
});<commit_msg>Fixed boards not 'activating' when loaded<commit_after>Meteor.methods({
    GETBoard: function(boardId) {
        var board = Boards.findOne({id:boardId});
        // if board has been activated do nothing
        if(board.active)
            return;
        // remove old data
        Lanes.remove({board:boardId});
        Cards.remove({board:boardId});
        Buckets.remove({board:boardId});
        Milestones.remove({board:boardId});
        var users_url = HOST+API+'users/';
        var board_url = HOST+API+'boards/'+boardId+'/';
        var lanes_url = board_url+'lanes/';
        var cards_url = board_url+'cards/?archived=false';
        var buckets_url = board_url+'buckets/';
        var milestones_url = board_url+'milestones/';
        sortToCollection(lanes_url,Lanes);
        sortToCollection(cards_url,Cards);
        getToCollection(buckets_url,Buckets);
        getToCollection(milestones_url,Milestones);
        // get assignees and checklists for each card in board
        var cards = Cards.find({board:boardId});
        // keep track of the highest cardNumber for making new cards
        var nextCardNumber=0;
        cards.forEach(function (card) {
            var cardNumber = card.header.cardNumber;
            if( cardNumber > nextCardNumber) {
                nextCardNumber=cardNumber;
            }
            var checklist_url = HOST+API+'card/'+card.id+'/checklists/';
            var assignees_url = HOST+API+'card/'+card.id+'/assignees/';
            Assignees.remove({card:card.id});
            Checklists.remove({card:card.id});
            getToCollection(checklist_url,Checklists);
            getToCollection(assignees_url,Assignees);
            checkListItems = Checklists.find({})
            checkListItems.forEach( function(checkListItem) {
                var ticked = Meteor.call('getEventTicked', checkListItem.id);
                Checklists.update(checkListItem, {'$set' : {'checked' : ticked }})
            });
        });
        // set board to active and update nextCardNumber
        Boards.update(board,{ 
            '$set': {'active':true,'nextCardNumber':nextCardNumber}
        });
    }
});
{'fraction_non_alphanumeric': 0.1241602965022006, 'fraction_numerical': 0.000463284688441047, 'mean_word_length': 2.389324960753532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2730428', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1226, 'n_words': 225}