From cbd01a0ccab5b556d8eaabf7da8305f3108909df Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 18 Jun 2021 11:55:49 +0200 Subject: [PATCH] REFACTOR: removes unused code (#13412) This has been fully useless since this fix https://github.com/discourse/discourse/pull/12865 The removed test is not actually real life behavior, category should be on a topic type not a fruit. --- app/assets/javascripts/discourse/app/models/store.js | 9 --------- .../discourse/tests/unit/services/store-test.js | 2 -- 2 files changed, 11 deletions(-) diff --git a/app/assets/javascripts/discourse/app/models/store.js b/app/assets/javascripts/discourse/app/models/store.js index d1783c08ef3..ffac278f1c7 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 28d676453b1..7e2e8184034 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) {