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:
parent
0fd55acf84
commit
cbd01a0cca
|
@ -1,5 +1,4 @@
|
||||||
import EmberObject, { set } from "@ember/object";
|
import EmberObject, { set } from "@ember/object";
|
||||||
import Category from "discourse/models/category";
|
|
||||||
import { Promise } from "rsvp";
|
import { Promise } from "rsvp";
|
||||||
import RestModel from "discourse/models/rest";
|
import RestModel from "discourse/models/rest";
|
||||||
import ResultSet from "discourse/models/result-set";
|
import ResultSet from "discourse/models/result-set";
|
||||||
|
@ -278,14 +277,6 @@ export default EmberObject.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_lookupSubType(subType, type, id, root) {
|
_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) {
|
if (root.meta && root.meta.types) {
|
||||||
subType = root.meta.types[subType] || subType;
|
subType = root.meta.types[subType] || subType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,8 +142,6 @@ module("Unit | Service | store", function () {
|
||||||
assert.equal(fruitCols.length, 2);
|
assert.equal(fruitCols.length, 2);
|
||||||
assert.equal(fruitCols[0].get("id"), 1);
|
assert.equal(fruitCols[0].get("id"), 1);
|
||||||
assert.equal(fruitCols[1].get("id"), 2);
|
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) {
|
test("embedded records can be cleared", async function (assert) {
|
||||||
|
|
Loading…
Reference in New Issue