DEV: Add Ember-CLI backwards compatibility for Discourse.Site (#15847)

This commit is contained in:
David Taylor 2022-02-07 18:39:34 +00:00 committed by GitHub
parent 9bfe5e58d3
commit cd460155aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import { setDefaultOwner } from "discourse-common/lib/get-owner";
import { isLegacyEmber } from "discourse-common/config/environment";
import User from "discourse/models/user";
import Site from "discourse/models/site";
import deprecated from "discourse-common/lib/deprecated";
export default {
@ -35,6 +36,18 @@ export default {
return User;
},
});
Object.defineProperty(app, "Site", {
get() {
deprecated(
`import discourse/models/site instead of using Discourse.Site`,
{
since: "2.8",
dropFrom: "2.9",
}
);
return Site;
},
});
}
},
};