<commit_before>import { Injectable } from '@angular/core';

import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { IEntity } from '../../shared/interfaces';
import { AuthService } from '../../shared/services';

@Injectable()
export abstract class AbstractFirebaseService<T extends IEntity> {

  protected abstract get entityPath(): string;

  protected list: FirebaseListObservable<IEntity[]>;

  constructor(
    protected angularFire: AngularFire,
    protected authService: AuthService
  ) {
    this.list = angularFire.database.list(this.entityPath)
  }

  get(entityId: string) {
    return this.angularFire.database.object(`${this.entityPath}/${entityId}`);
  }

  create(entity: T): firebase.database.ThenableReference {
    return this.list.push(entity);
  }

  update(entity: T, changes: Object): firebase.Promise<any> {
    return this.list.$ref.child(entity.$key).set(changes);
  }

  delete(entity: T): firebase.Promise<any> {
    return this.list.remove(entity.$key);
  }
}
<commit_msg>Reverted initial change for update method<commit_after>import { Injectable } from '@angular/core';

import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { IEntity } from '../../shared/interfaces';
import { AuthService } from '../../shared/services';

@Injectable()
export abstract class AbstractFirebaseService<T extends IEntity> {

  protected abstract get entityPath(): string;

  protected list: FirebaseListObservable<IEntity[]>;

  constructor(
    protected angularFire: AngularFire,
    protected authService: AuthService
  ) {
    this.list = angularFire.database.list(this.entityPath)
  }

  get(entityId: string) {
    return this.angularFire.database.object(`${this.entityPath}/${entityId}`);
  }

  create(entity: T): firebase.database.ThenableReference {
    return this.list.push(entity);
  }

  update(entity: T, changes: Object): firebase.Promise<any> {
    return this.list.update(entity.$key, changes);
  }

  delete(entity: T): firebase.Promise<any> {
    return this.list.remove(entity.$key);
  }
}

{'fraction_non_alphanumeric': 0.13773035887487875, 'fraction_numerical': 0.0009699321047526673, 'mean_word_length': 4.501333333333333, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3516707', 'n_tokens_mistral': 622, 'n_tokens_neox': 611, 'n_words': 130}