mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 05:03:39 +08:00
DEV: Add Ember-CLI backwards compatibility for Discourse.Site (#15847)
This commit is contained in:
parent
9bfe5e58d3
commit
cd460155aa
|
@ -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;
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user