Merge pull request #7969 from FreeCodeCamp/staging

Release Staging
This commit is contained in:
Berkeley Martinez
2016-04-07 17:08:44 -07:00
2 changed files with 35 additions and 15 deletions

View File

@ -1,22 +1,34 @@
#### FreeCodeCamp Issue template <!--
To Use this Template: FreeCodeCamp Issue Template
* Fill out what you can NOTE: ISSUES ARE NOT FOR CODE HELP - Ask for Help at
* Delete what you do not fill out https://gitter.im/FreeCodeCamp/Help
-->
#### Challenge Name
<!-- Insert link to challenge below -->
NOTE: ISSUES ARE NOT FOR CODE HELP - Ask for Help at https://gitter.im/FreeCodeCamp/Help
#### Issue Description #### Issue Description
* When Issue Happens
* Steps To Reproduce <!-- Describe below when the issue happens and how to reproduce it -->
#### Browser Information #### Browser Information
* Browser Name, Version
* Operating System <!-- Describe your workspace in which you are having issues-->
* Browser Name, Version:
* Operating System:
* Mobile, Desktop, or Tablet:
#### Your Code #### Your Code
```js ```js
If relevant, paste all of your challenge code in here // If relevant, paste all of your challenge code in here
``` ```
#### Screenshot #### Screenshot

View File

@ -104,11 +104,19 @@ export default function migrateCompletedChallenges() {
if (!user || user.isChallengeMapMigrated) { if (!user || user.isChallengeMapMigrated) {
return next(); return next();
} }
return buildChallengeMap( const id = user.id.toString();
user.id.toString(), return User.findOne$({
user.completedChallenges, where: { id },
User fields: { completedChallenges: true }
) })
.map(({ completedChallenges = [] } = {}) => completedChallenges)
.flatMap(completedChallenges => {
return buildChallengeMap(
id,
completedChallenges,
User
);
})
.subscribe( .subscribe(
count => log('documents update', count), count => log('documents update', count),
// errors go here // errors go here