REFACTOR: removes unused code (#13412)

REFACTOR: removes unused code (#13412)

This has been fully useless since this fix FIX: ensures successive topic hydrates doesn't override category by jjaffeux · Pull Request #12865 · discourse/discourse · GitHub

The removed test is not actually real life behavior, category should be on a topic type not a fruit.

diff --git a/app/assets/javascripts/discourse/app/models/store.js b/app/assets/javascripts/discourse/app/models/store.js
index d1783c0..ffac278 100644
--- a/app/assets/javascripts/discourse/app/models/store.js
+++ b/app/assets/javascripts/discourse/app/models/store.js
@@ -1,5 +1,4 @@
 import EmberObject, { set } from "@ember/object";
-import Category from "discourse/models/category";
 import { Promise } from "rsvp";
 import RestModel from "discourse/models/rest";
 import ResultSet from "discourse/models/result-set";
@@ -278,14 +277,6 @@ export default EmberObject.extend({
   },
 
   _lookupSubType(subType, type, id, root) {
-    // cheat: we know we already have categories in memory
-    // TODO: topics do their own resolving of `category_id`
-    // to category. That should either respect this or be
-    // removed.
-    if (subType === "category" && type !== "topic") {
-      return Category.findById(id);
-    }
-
     if (root.meta && root.meta.types) {
       subType = root.meta.types[subType] || subType;
     }
diff --git a/app/assets/javascripts/discourse/tests/unit/services/store-test.js b/app/assets/javascripts/discourse/tests/unit/services/store-test.js
index 28d6764..7e2e818 100644
--- a/app/assets/javascripts/discourse/tests/unit/services/store-test.js
+++ b/app/assets/javascripts/discourse/tests/unit/services/store-test.js
@@ -142,8 +142,6 @@ module("Unit | Service | store", function () {
     assert.equal(fruitCols.length, 2);
     assert.equal(fruitCols[0].get("id"), 1);
     assert.equal(fruitCols[1].get("id"), 2);
-
-    assert.ok(fruit.get("category"), "categories are found automatically");
   });
 
   test("embedded records can be cleared", async function (assert) {

GitHub sha: cbd01a0ccab5b556d8eaabf7da8305f3108909df

This commit appears in #13412 which was approved by ZogStriP and eviltrout. It was merged by jjaffeux.