mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 03:43:38 +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 { setDefaultOwner } from "discourse-common/lib/get-owner";
|
||||||
import { isLegacyEmber } from "discourse-common/config/environment";
|
import { isLegacyEmber } from "discourse-common/config/environment";
|
||||||
import User from "discourse/models/user";
|
import User from "discourse/models/user";
|
||||||
|
import Site from "discourse/models/site";
|
||||||
import deprecated from "discourse-common/lib/deprecated";
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -35,6 +36,18 @@ export default {
|
||||||
return User;
|
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