<commit_before>define(
    'view/articleComment',
    [
        'jquery',
        'backbone'
    ],
    function ($, Backbone) {
        'use strict';

        var ArticleCommentsView = Backbone.View.extend({
            template: _.template( $('#tmp-article-comments').html() ),

            el: '.discussion',

            initialize: function (activeModel) {
                this.activeModel = activeModel;
                this.listenTo(this.activeModel, 'change', this.fetchComments);
            },

            fetchComments: function(){
                this.activeModel.comments.reset();
                this.activeModel.comments.on('add', this.render, this);
                this.activeModel.comments.fetch();<commit_msg>Fixed bug with updating view when loading comments of a different article<commit_after>define(
    'view/articleComment',
    [
        'jquery',
        'backbone'
    ],
    function ($, Backbone) {
        'use strict';

        var ArticleCommentsView = Backbone.View.extend({
            template: _.template( $('#tmp-article-comments').html() ),

            el: '.discussion',

            initialize: function (activeModel) {
                this.activeModel = activeModel;
                this.listenTo(this.activeModel, 'change', this.fetchComments);
                this.listenTo(this.activeModel.comments, 'sync', this.render);
                this.listenTo(this.activeModel.comments, 'add', this.render);
            },

            fetchComments: function(){
                this.activeModel.comments.reset();
                this.activeModel.comments.fetch();
{'fraction_non_alphanumeric': 0.12663755458515283, 'fraction_numerical': 0.0, 'mean_word_length': 1.9648798521256932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7226449', 'n_tokens_mistral': 420, 'n_tokens_neox': 392, 'n_words': 75}