<commit_before>/* global define */

define([
  'controllers/base-controller',
  'views/comments-view',
  'collections/comment-collection'
], function (BaseController, CommentsView, Comments) {
  'use strict';

  var CommentsController = BaseController.extend({
    showComments: function (options) {
      this.collection = this._commentsFromPost(options.model);
      this.show(this._commentsView(this.collection, options.model), { loading: true, region: options.region });
    },

    _commentsFromPost: function (model) {
      return new Comments({ uri: model.get('meta').links['b3:replies'] });
    },

    _commentsView: function (collection, model) {
      return new CommentsView({ collection: collection, model: model });
    }
  });

  return CommentsController;
});<commit_msg>Fetch either b3:replies or replies<commit_after>/* global define */

define([
  'controllers/base-controller',
  'views/comments-view',
  'collections/comment-collection'
], function (BaseController, CommentsView, Comments) {
  'use strict';

  var CommentsController = BaseController.extend({
    showComments: function (options) {
      this.collection = this._commentsFromPost(options.model);
      this.show(this._commentsView(this.collection, options.model), { loading: true, region: options.region });
    },

    _commentsFromPost: function (model) {
      var links = model.get('meta').links,
          uri   = links['b3:replies'] || links.replies;
      return new Comments({ uri: uri });
    },

    _commentsView: function (collection, model) {
      return new CommentsView({ collection: collection, model: model });
    }
  });

  return CommentsController;
});
{'fraction_non_alphanumeric': 0.13838748495788206, 'fraction_numerical': 0.0018050541516245488, 'mean_word_length': 3.993993993993994, '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': '7573789', 'n_tokens_mistral': 467, 'n_tokens_neox': 459, 'n_words': 106}