<commit_before>const ADMIN_MODELS = ['plugin'];

export default Ember.Object.extend({
  pathFor(store, type, findArgs) {
    let path = "/" + Ember.String.underscore(store.pluralize(type));

    if (ADMIN_MODELS.indexOf(type) !== -1) { path = "/admin/" + path; }

    if (findArgs) {
      if (typeof findArgs === "object") {
        const queryString = Object.keys(findArgs)
                                  .reject(k => !findArgs[k])
                                  .map(k => k + "=" + encodeURIComponent(findArgs[k]));

        if (queryString.length) {
          path += "?" + queryString.join('&');
        }
      } else {
        // It's serializable as a string if not an object
        path += "/" + findArgs;
      }
    }

    return path;
  },

  findAll(store, type) {
    return Discourse.ajax(this.pathFor(store, type));<commit_msg>FIX: Double slash with finder for admin routes<commit_after>const ADMIN_MODELS = ['plugin'];

export default Ember.Object.extend({
  pathFor(store, type, findArgs) {
    let path = "/" + Ember.String.underscore(store.pluralize(type));

    if (ADMIN_MODELS.indexOf(type) !== -1) { path = "/admin" + path; }

    if (findArgs) {
      if (typeof findArgs === "object") {
        const queryString = Object.keys(findArgs)
                                  .reject(k => !findArgs[k])
                                  .map(k => k + "=" + encodeURIComponent(findArgs[k]));

        if (queryString.length) {
          path += "?" + queryString.join('&');
        }
      } else {
        // It's serializable as a string if not an object
        path += "/" + findArgs;
      }
    }

    return path;
  },

  findAll(store, type) {
    return Discourse.ajax(this.pathFor(store, type));
{'fraction_non_alphanumeric': 0.15473441108545036, 'fraction_numerical': 0.0011547344110854503, 'mean_word_length': 2.056437389770723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6738723', 'n_tokens_mistral': 551, 'n_tokens_neox': 532, 'n_words': 116}