mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
Restructured public settings cache hash
refs https://github.com/TryGhost/Team/issues/509 - Flipping around key/newKey pair allows to map multiple keys to the same field in the settings - This becomes handy when there's a need to deprecate a field. For example, we are about to introduce a 'locale' setting which would need to map to 'lang' db key, with current structure it's impossible to have many:1 mapping because it's impossible to have duplicate keys in the JS object ("hash")
This commit is contained in:
parent
2e2d185087
commit
c2a3297f5d
@ -99,7 +99,7 @@ module.exports = {
|
|||||||
getPublic() {
|
getPublic() {
|
||||||
let settings = {};
|
let settings = {};
|
||||||
|
|
||||||
_.each(publicSettings, (newKey, key) => {
|
_.each(publicSettings, (key, newKey) => {
|
||||||
settings[newKey] = doGet(key) || null;
|
settings[newKey] = doGet(key) || null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user