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.
This commit is contained in:
Joffrey JAFFEUX 2021-06-18 11:55:49 +02:00 committed by GitHub
parent 0fd55acf84
commit cbd01a0cca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 11 deletions

View File

@ -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;
}

View File

@ -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) {