<commit_before>function doFixture(fixture) {
    //first, check if this fixture is populated
    fixture.model.findOne(fixture.data[0], function(err, output) {

        if(err) sails.log("Error in fixtures: " + err);
        else if(!output) {

            //if it's not populated, insert data
            sails.log("Running fixture: " + fixture.name);
            fixture.data.forEach(function(item) {

                fixture.model.create(item).exec(function(e, newItem) {
                    if(e) sails.log("Error in fixture '"+fixture.name+"': " + e);
                });
            });
        }
        else if(output) 
            sails.log("Ignoring fixture: " + fixture.name);
    });
}



module.exports = {
    run: function() {

        fixtureBadgeType = {
            name: "Badge_type",
            model: Badge_type, 
            data: [ 
                {name: "Skilled"},
                {name: "Creative"}, 
                {name: "Editing"},
                {name: "Humor"}
            ]
        };

        fixtureChampionRole = {
            name: "Champion_role",
            model: Champion_role,
            data: [
                {name: "Top"},
                {name: "Jungle"},
                {name: "Mid"},
                {name: "Ad Carry"},
                {name: "Support"}
            ]
        };

        fixtureSubmissionType = {
            name: "Submission_type",
            model: Submission_type,
            data: [
                {name: "Tutorial"},
                {name: "Montage"},
                {name: "Full Game"}
            ]
        };

        fixtureUserType = {
            name: "User_type",
            model: User_type,
            data: [
                {utype: "Administrator"},
                {utype: "Approver"},
                {utype: "User"}
            ]
        };

        fixtures = [
            fixtureBadgeType,
            fixtureChampionRole,<commit_msg>modify fixture to work with new names<commit_after>function doFixture(fixture) {
    //first, check if this fixture is populated
    fixture.model.findOne(fixture.data[0], function(err, output) {

        if(err) sails.log("Error in fixtures: " + err);
        else if(!output) {

            //if it's not populated, insert data
            sails.log("Running fixture: " + fixture.name);
            fixture.data.forEach(function(item) {

                fixture.model.create(item).exec(function(e, newItem) {
                    if(e) sails.log("Error in fixture '"+fixture.name+"': " + e);
                });
            });
        }
        else if(output) 
            sails.log("Ignoring fixture: " + fixture.name);
    });
}



module.exports = {
    run: function() {

        fixtureBadgeType = {
            name: "BadgeType",
            model: BadgeType, 
            data: [ 
                {name: "Skilled"},
                {name: "Creative"}, 
                {name: "Editing"},
                {name: "Humor"}
            ]
        };

        fixtureChampionRole = {
            name: "ChampionRole",
            model: ChampionRole,
            data: [
                {name: "Top"},
                {name: "Jungle"},
                {name: "Mid"},
                {name: "<NAME>"},
                {name: "Support"}
            ]
        };

        fixtureSubmissionType = {
            name: "SubmissionType",
            model: SubmissionType,
            data: [
                {name: "Tutorial"},
                {name: "Montage"},
                {name: "Full Game"}
            ]
        };

        fixtureUserType = {
            name: "UserType",
            model: UserType,
            data: [
                {utype: "Administrator"},
                {utype: "Approver"},
                {utype: "User"}
            ]
        };

        fixtures = [
            fixtureBadgeType,
            fixtureChampionRole,
{'fraction_non_alphanumeric': 0.12969634585692227, 'fraction_numerical': 0.000514668039114771, 'mean_word_length': 1.2287844036697249, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '783732', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1056, 'n_words': 212}