<commit_before>import Ember from 'ember';

export var Navigator = Ember.Object.extend({
  controller: null,

  model: Ember.computed.oneWay('controller.navigableModel'),
  models: Ember.computed.oneWay('controller.navigableModels'),
  modelRouteParams: Ember.computed.oneWay('controller.modelRouteParams'),

  previousModel: null,
  nextModel: null,

  firstModel: Ember.computed.oneWay('models.firstObject'),
  lastModel: Ember.computed.oneWay('models.lastObject'),

  isFirstModel: Ember.computed('model', 'firstModel', function() {
    return this.get('model') === this.get('firstModel');
  }),

  isLastModel: Ember.computed('model', 'lastModel', function() {
    return this.get('model') === this.get('lastModel');
  }),

  disablePrevious: Ember.computed.oneWay('isFirstModel'),
  disableNext: Ember.computed.oneWay('isLastModel'),

  updatePreviousAndNextModels: Ember.on('init', Ember.observer('model', 'models.[]', function() {
    this.set('previousModel', this.getPreviousModel());
    this.set('nextModel', this.getNextModel());
  })),

  getPreviousModel: function() {<commit_msg>Don't update links to previous and next models when collection changes<commit_after>import Ember from 'ember';

export var Navigator = Ember.Object.extend({
  controller: null,

  model: Ember.computed.oneWay('controller.navigableModel'),
  models: Ember.computed.oneWay('controller.navigableModels'),
  modelRouteParams: Ember.computed.oneWay('controller.modelRouteParams'),

  previousModel: null,
  nextModel: null,

  firstModel: Ember.computed.oneWay('models.firstObject'),
  lastModel: Ember.computed.oneWay('models.lastObject'),

  isFirstModel: Ember.computed('model', 'firstModel', function() {
    return this.get('model') === this.get('firstModel');
  }),

  isLastModel: Ember.computed('model', 'lastModel', function() {
    return this.get('model') === this.get('lastModel');
  }),

  disablePrevious: Ember.computed.oneWay('isFirstModel'),
  disableNext: Ember.computed.oneWay('isLastModel'),

  updatePreviousAndNextModels: Ember.on('init', Ember.observer('model', function() {
    this.set('previousModel', this.getPreviousModel());
    this.set('nextModel', this.getNextModel());
  })),

  getPreviousModel: function() {
{'fraction_non_alphanumeric': 0.16278026905829596, 'fraction_numerical': 0.0, 'mean_word_length': 5.993730407523511, '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': '3496894', 'n_tokens_mistral': 718, 'n_tokens_neox': 684, 'n_words': 115}