File tree Expand file tree Collapse file tree
ee/lib/autoUpdateStacks/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,6 +108,13 @@ module.exports = {
108108 instance : {
109109 projectCount : async function ( ) {
110110 return await M . Project . count ( { where : { ProjectStackId : this . id } } )
111+ } ,
112+ findLatestStack : async function ( ) {
113+ if ( this . replacedBy ) {
114+ return ( await M . ProjectStack . byId ( this . replacedBy ) ) . findLatestStack ( )
115+ } else {
116+ return this
117+ }
111118 }
112119 }
113120 }
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ module.exports = {
2525 if ( project . Project . ProjectStack . replacedBy ) {
2626 // need to add audit logging
2727 try {
28- const newStack = await app . db . models . ProjectStack . byId ( project . Project . ProjectStack . replacedBy )
28+ const newStack = await project . Project . ProjectStack . findLatestStack ( )
2929 app . log . info ( `Updating project ${ project . Project . id } to stack: '${ newStack . hashid } '` )
3030
3131 const suspendOptions = {
You can’t perform that action at this time.
0 commit comments