Added more fields to Person schema in tests.

--- tests.coffee
+++ tests.coffee
@@ -20,13 +20,13 @@
     name: 'Post'
     fields: =>
       # We can reference other document
-      author: @ReferenceField Person, ['username', 'displayName']
+      author: @ReferenceField Person, ['username', 'displayName', 'field1', 'field2']
       # Or an array of documents
       subscribers: [@ReferenceField Person]
       # Fields can be arbitrary MongoDB projections
       reviewers: [@ReferenceField Person, [username: 1]]
       subdocument:
-        person: @ReferenceField Person, ['username'], false
+        person: @ReferenceField Person, ['username', 'displayName', 'field1', 'field2'], false
         slug: @GeneratedField 'self', ['body', 'subdocument.body'], (fields) ->
           if _.isUndefined(fields.body) or _.isUndefined(fields.subdocument?.body)
             [fields._id, undefined]
@@ -35,7 +35,7 @@
           else
             [fields._id, "subdocument-prefix-#{ fields.body.toLowerCase() }-#{ fields.subdocument.body.toLowerCase() }-suffix"]
       nested: [
-        required: @ReferenceField Person, ['username']
+        required: @ReferenceField Person, ['username', 'displayName', 'field1', 'field2']
         optional: @ReferenceField Person, ['username'], false
         slug: @GeneratedField 'self', ['body', 'nested.body'], (fields) ->
           for nested in fields.nested or []
@@ -73,7 +73,7 @@
     name: 'Post'
     replaceParent: true
     fields: (fields) =>
-      fields.subdocument.persons = [@ReferenceField Person, ['username']]
+      fields.subdocument.persons = [@ReferenceField Person, ['username', 'displayName', 'field1', 'field2']]
       fields

 # Store away for testing
@@ -141,6 +141,8 @@
   # Other fields:
   #   username
   #   displayName
+  #   field1
+  #   field2

   @Meta
     name: 'Person'
@@ -238,7 +240,7 @@
   test.equal Post.Meta.fields.author.targetCollection._name, 'Persons'
   test.equal Post.Meta.fields.author.sourceDocument.Meta.collection._name, 'Posts'
   test.equal Post.Meta.fields.author.targetDocument.Meta.collection._name, 'Persons'
-  test.equal Post.Meta.fields.author.fields, ['username', 'displayName']
+  test.equal Post.Meta.fields.author.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf Post.Meta.fields.subscribers, Person._ReferenceField
   test.equal Post.Meta.fields.subscribers.ancestorArray, 'subscribers'
   test.isTrue Post.Meta.fields.subscribers.required
@@ -272,7 +274,7 @@
   test.equal Post.Meta.fields.subdocument.person.targetCollection._name, 'Persons'
   test.equal Post.Meta.fields.subdocument.person.sourceDocument.Meta.collection._name, 'Posts'
   test.equal Post.Meta.fields.subdocument.person.targetDocument.Meta.collection._name, 'Persons'
-  test.equal Post.Meta.fields.subdocument.person.fields, ['username']
+  test.equal Post.Meta.fields.subdocument.person.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf Post.Meta.fields.subdocument.persons, Person._ReferenceField
   test.equal Post.Meta.fields.subdocument.persons.ancestorArray, 'subdocument.persons'
   test.isTrue Post.Meta.fields.subdocument.persons.required
@@ -283,7 +285,7 @@
   test.equal Post.Meta.fields.subdocument.persons.targetCollection._name, 'Persons'
   test.equal Post.Meta.fields.subdocument.persons.sourceDocument.Meta.collection._name, 'Posts'
   test.equal Post.Meta.fields.subdocument.persons.targetDocument.Meta.collection._name, 'Persons'
-  test.equal Post.Meta.fields.subdocument.persons.fields, ['username']
+  test.equal Post.Meta.fields.subdocument.persons.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf Post.Meta.fields.subdocument.slug, Person._GeneratedField
   test.isNull Post.Meta.fields.subdocument.slug.ancestorArray, Post.Meta.fields.subdocument.slug.ancestorArray
   test.isTrue _.isFunction Post.Meta.fields.subdocument.slug.generator
@@ -306,7 +308,7 @@
   test.equal Post.Meta.fields.nested.required.targetCollection._name, 'Persons'
   test.equal Post.Meta.fields.nested.required.sourceDocument.Meta.collection._name, 'Posts'
   test.equal Post.Meta.fields.nested.required.targetDocument.Meta.collection._name, 'Persons'
-  test.equal Post.Meta.fields.nested.required.fields, ['username']
+  test.equal Post.Meta.fields.nested.required.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf Post.Meta.fields.nested.optional, Person._ReferenceField
   test.equal Post.Meta.fields.nested.optional.ancestorArray, 'nested'
   test.isFalse Post.Meta.fields.nested.optional.required
@@ -482,7 +484,7 @@
   test.equal SpecialPost.Meta.fields.author.targetCollection._name, 'Persons'
   test.equal SpecialPost.Meta.fields.author.sourceDocument.Meta.collection._name, 'SpecialPosts'
   test.equal SpecialPost.Meta.fields.author.targetDocument.Meta.collection._name, 'Persons'
-  test.equal SpecialPost.Meta.fields.author.fields, ['username', 'displayName']
+  test.equal SpecialPost.Meta.fields.author.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf SpecialPost.Meta.fields.subscribers, Person._ReferenceField
   test.equal SpecialPost.Meta.fields.subscribers.ancestorArray, 'subscribers'
   test.isTrue SpecialPost.Meta.fields.subscribers.required
@@ -516,7 +518,7 @@
   test.equal SpecialPost.Meta.fields.subdocument.person.targetCollection._name, 'Persons'
   test.equal SpecialPost.Meta.fields.subdocument.person.sourceDocument.Meta.collection._name, 'SpecialPosts'
   test.equal SpecialPost.Meta.fields.subdocument.person.targetDocument.Meta.collection._name, 'Persons'
-  test.equal SpecialPost.Meta.fields.subdocument.person.fields, ['username']
+  test.equal SpecialPost.Meta.fields.subdocument.person.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf SpecialPost.Meta.fields.subdocument.persons, Person._ReferenceField
   test.equal SpecialPost.Meta.fields.subdocument.persons.ancestorArray, 'subdocument.persons'
   test.isTrue SpecialPost.Meta.fields.subdocument.persons.required
@@ -527,7 +529,7 @@
   test.equal SpecialPost.Meta.fields.subdocument.persons.targetCollection._name, 'Persons'
   test.equal SpecialPost.Meta.fields.subdocument.persons.sourceDocument.Meta.collection._name, 'SpecialPosts'
   test.equal SpecialPost.Meta.fields.subdocument.persons.targetDocument.Meta.collection._name, 'Persons'
-  test.equal SpecialPost.Meta.fields.subdocument.persons.fields, ['username']
+  test.equal SpecialPost.Meta.fields.subdocument.persons.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf SpecialPost.Meta.fields.subdocument.slug, Person._GeneratedField
   test.isNull SpecialPost.Meta.fields.subdocument.slug.ancestorArray, SpecialPost.Meta.fields.subdocument.slug.ancestorArray
   test.isTrue _.isFunction SpecialPost.Meta.fields.subdocument.slug.generator
@@ -550,7 +552,7 @@
   test.equal SpecialPost.Meta.fields.nested.required.targetCollection._name, 'Persons'
   test.equal SpecialPost.Meta.fields.nested.required.sourceDocument.Meta.collection._name, 'SpecialPosts'
   test.equal SpecialPost.Meta.fields.nested.required.targetDocument.Meta.collection._name, 'Persons'
-  test.equal SpecialPost.Meta.fields.nested.required.fields, ['username']
+  test.equal SpecialPost.Meta.fields.nested.required.fields, ['username', 'displayName', 'field1', 'field2']
   test.instanceOf SpecialPost.Meta.fields.nested.optional, Person._ReferenceField
   test.equal SpecialPost.Meta.fields.nested.optional.ancestorArray, 'nested'
   test.isFalse SpecialPost.Meta.fields.nested.optional.required
@@ -699,6 +701,7 @@
       subdocument:
         person:
           _id: @person2._id
+          username: 'wrong'
         persons: [
           _id: @person2._id
         ,
@@ -709,6 +712,7 @@
         required:
           _id: @person2._id
           username: 'wrong'
+          displayName: 'wrong'
         optional:
           _id: @person3._id
           username: 'wrong'
@@ -755,12 +759,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -768,6 +775,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -858,12 +866,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -871,6 +882,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -914,9 +926,11 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -924,6 +938,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional: null
         slug: 'nested-prefix-foobar-nestedfoobar-suffix'
         body: 'NestedFooBar'
@@ -1824,12 +1839,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -1837,6 +1855,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -1875,12 +1894,15 @@
           person:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           persons: [
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           ,
             _id: @person3._id
             username: @person3.username
+            displayName: @person3.displayName
           ]

     Person.documents.update @person2Id,
@@ -1913,12 +1935,15 @@
           person:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           persons: [
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           ,
             _id: @person3._id
             username: @person3.username
+            displayName: @person3.displayName
           ]

     Person.documents.remove @person2Id,
@@ -1942,6 +1967,7 @@
           persons: [
             _id: @person3._id
             username: @person3.username
+            displayName: @person3.displayName
           ]

     Post.documents.remove @post._id,
@@ -2068,12 +2094,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -2081,6 +2110,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -2136,12 +2166,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobarz-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -2149,6 +2182,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -2204,12 +2238,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobarz-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -2217,6 +2254,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -2272,12 +2310,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobarz-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -2285,6 +2326,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -2336,12 +2378,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: null
         body: 'SubdocumentFooBarZ'
@@ -2349,6 +2394,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -2397,18 +2443,22 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         body: 'SubdocumentFooBarZ'
       nested: [
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -3142,18 +3192,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -3161,51 +3216,57 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -3304,18 +3365,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -3323,51 +3389,57 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -3434,18 +3506,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -3453,51 +3530,57 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -3562,62 +3645,73 @@
       subdocument:
         person:
           _id: @person2._id
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
-        ,
-          _id: @person2._id
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
       nested: [
         required:
           _id: @person2._id
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -3680,55 +3774,66 @@
       subdocument:
         person:
           _id: @person2._id
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
-        ,
-          _id: @person2._id
-        ,
-          _id: @person3._id
-        ,
-          _id: @person3._id
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
       nested: [
         required:
           _id: @person2._id
-        optional:
-          _id: @person3._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-        optional:
-          _id: @person3._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
         slug: 'nested-prefix-foobar-nestedfoobar-suffix'
@@ -3791,55 +3896,66 @@
       subdocument:
         person:
           _id: @person2._id
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
-        ,
-          _id: @person2._id
-        ,
-          _id: @person3._id
-        ,
-          _id: @person3._id
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
       nested: [
         required:
           _id: @person2._id
-        optional:
-          _id: @person3._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-        optional:
-          _id: @person3._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-        optional:
-          _id: @person2._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
         slug: 'nested-prefix-foobar-nestedfoobar-suffix'
@@ -3904,16 +4020,21 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-        ,
-          _id: @person3._id
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -3921,46 +4042,52 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person3._id
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
         slug: 'nested-prefix-foobar-nestedfoobar-suffix'
@@ -4027,18 +4154,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -4046,51 +4178,57 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4152,18 +4290,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -4171,51 +4314,57 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4277,18 +4426,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -4296,6 +4450,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4305,42 +4460,47 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4402,18 +4562,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -4421,6 +4586,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4430,33 +4596,37 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person2._id
-          username: @person2.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4466,6 +4636,7 @@
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4527,18 +4698,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -4546,6 +4722,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4555,24 +4732,27 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4582,6 +4762,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4591,6 +4772,7 @@
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4651,18 +4833,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -4670,6 +4857,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4679,22 +4867,25 @@
         required:
           _id: @person2._id
           username: @person2.username
-        optional:
-          _id: @person3._id
-          username: @person3.username
-        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
-        body: 'NestedFooBar'
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        optional:
+          _id: @person3._id
+          username: @person3.username
+        slug: 'nested-prefix-foobar-nestedfoobar-suffix'
+        body: 'NestedFooBar'
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4704,6 +4895,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4713,6 +4905,7 @@
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4772,18 +4965,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobarz-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -4791,6 +4989,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4800,6 +4999,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4809,13 +5009,15 @@
         required:
           _id: @person3._id
           username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4825,6 +5027,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4834,6 +5037,7 @@
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4898,18 +5102,23 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person2._id
-          username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person2._id
+          username: @person2.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobarz-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -4917,6 +5126,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4926,6 +5136,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4935,13 +5146,15 @@
         required:
           _id: @person3._id
           username: @person3.username
-        optional:
-          _id: @person2._id
-          username: @person2.username
-      ,
-        required:
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person3.displayName
+        optional:
+          _id: @person2._id
+          username: @person2.username
+      ,
+        required:
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4951,6 +5164,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person2._id
           username: @person2.username
@@ -4960,6 +5174,7 @@
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -4969,6 +5184,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -5019,9 +5235,11 @@
         persons: [
           _id: @person3._id
           username: @person3.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person3.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobarz-subdocumentfoobarz-suffix'
         body: 'SubdocumentFooBarZ'
@@ -5029,11 +5247,13 @@
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional: null
       ,
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional: null
         slug: null
         body: null
@@ -5041,6 +5261,7 @@
         required:
           _id: @person3._id
           username: @person3.username
+          displayName: @person3.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -5263,12 +5484,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -5276,6 +5500,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -5373,12 +5598,15 @@
         person:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         persons: [
           _id: @person2._id
           username: @person2.username
-        ,
-          _id: @person3._id
-          username: @person3.username
+          displayName: @person2.displayName
+        ,
+          _id: @person3._id
+          username: @person3.username
+          displayName: @person3.displayName
         ]
         slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
         body: 'SubdocumentFooBar'
@@ -5386,6 +5614,7 @@
         required:
           _id: @person2._id
           username: @person2.username
+          displayName: @person2.displayName
         optional:
           _id: @person3._id
           username: @person3.username
@@ -5602,12 +5831,15 @@
           person:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           persons: [
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           ,
             _id: @person3._id
             username: @person3.username
+            displayName: @person3.displayName
           ]
           slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
           body: 'SubdocumentFooBar'
@@ -5615,6 +5847,7 @@
           required:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           optional:
             _id: @person3._id
             username: @person3.username
@@ -5678,12 +5911,15 @@
           person:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           persons: [
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           ,
             _id: @person3._id
             username: @person3.username
+            displayName: @person3.displayName
           ]
           slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
           body: 'SubdocumentFooBar'
@@ -5691,6 +5927,7 @@
           required:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           optional:
             _id: @person3._id
             username: @person3.username
@@ -5733,12 +5970,15 @@
           person:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           persons: [
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           ,
             _id: @person3._id
             username: @person3.username
+            displayName: @person3.displayName
           ]
           slug: 'subdocument-prefix-foobar-subdocumentfoobar-suffix'
           body: 'SubdocumentFooBar'
@@ -5746,6 +5986,7 @@
           required:
             _id: @person2._id
             username: @person2.username
+            displayName: @person2.displayName
           optional:
             _id: @person3._id
             username: @person3.username


Wrong return

Wrong return

--- app/javascript/src/legacy/post.coffee
+++ app/javascript/src/legacy/post.coffee
@@ -340,7 +340,7 @@
     post = Post.posts.get(post_id)

     # Missing post data, pretend it's not blacklisted.
-    return true if !post?
+    return false if !post?

     has_tag = (tag) ->
       post.match_tags.indexOf(tag) != -1


add stylus to grammars that trigger tab expansion

--- keymaps/emmet.cson
+++ keymaps/emmet.cson
@@ -30,7 +30,7 @@

 # language-specific Tab triggers
 # you can add more triggers by changing `grammar` attribute values
-'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar~="erb"]:not([mini]), atom-text-editor[data-grammar~="jade"]:not([mini]), atom-text-editor[data-grammar~="css"]:not([mini]), atom-text-editor[data-grammar~="sass"]:not([mini])':
+'atom-text-editor[data-grammar="text html basic"]:not([mini]), atom-text-editor[data-grammar~="erb"]:not([mini]), atom-text-editor[data-grammar~="jade"]:not([mini]), atom-text-editor[data-grammar~="css"]:not([mini]), atom-text-editor[data-grammar~="stylus"]:not([mini]), atom-text-editor[data-grammar~="sass"]:not([mini])':
   'tab': 'emmet:expand-abbreviation-with-tab'

 '.platform-darwin atom-text-editor:not([mini])':


Fix #29

Fix #29

--- lib/process.coffee
+++ lib/process.coffee
@@ -143,18 +143,31 @@
         startIndex  = @core.editor.toIndex start
         end         = goal.range.end
         endIndex    = @core.editor.toIndex end
-        "( Range [Interval
-            (Pn
-                (Just (mkAbsolute \"#{@core.getPath()}\"))
-                #{startIndex + 3}
-                #{start.row + 1}
-                #{start.column + 3})
-            (Pn
-                (Just (mkAbsolute \"#{@core.getPath()}\"))
-                #{endIndex - 1}
-                #{end.row + 1}
-                #{end.column - 1})
-            ])"
+
+        if semver.gte(@agdaVersion.sem, '2.5.1')
+            "(intervalsToRange (Just (mkAbsolute \"#{@core.getPath()}\")) [Interval
+                (Pn
+                    ()
+                    #{startIndex + 3}
+                    #{start.row + 1}
+                    #{start.column + 3})
+                (Pn
+                    ()
+                    #{endIndex - 1}
+                    #{end.row + 1}
+                    #{end.column - 1})])"
+        else
+            "(Range [Interval
+                (Pn
+                    (Just (mkAbsolute \"#{@core.getPath()}\"))
+                    #{startIndex + 3}
+                    #{start.row + 1}
+                    #{start.column + 3})
+                (Pn
+                    (Just (mkAbsolute \"#{@core.getPath()}\"))
+                    #{endIndex - 1}
+                    #{end.row + 1}
+                    #{end.column - 1})])"

     sendCommand: (highlightingLevel, interaction) ->
         @wireAgdaProcess().then (agdaProcess) =>
@@ -164,6 +177,7 @@
                 command = "IOTCM \"#{filepath}\" #{highlightingLevel} #{highlightingMethod} ( #{interaction()} )\n"
             else
                 command = "IOTCM \"#{filepath}\" #{highlightingLevel} #{highlightingMethod} ( #{interaction} )\n"
+            console.log command
             agdaProcess.stdin.write command
             return agdaProcess


Follow mixin

Follow mixin

--- test/follow.coffee
+++ test/follow.coffee
@@ -14,7 +14,6 @@
     height: 10

   enemy.include(Follow)
-
   enemy.follow(player)

   ok enemy.I.velocity.equal(Point(1, 0))


Follow mixin

Follow mixin

--- test/follow.coffee
+++ test/follow.coffee
@@ -15,6 +15,6 @@

   enemy.include(Follow)

-  enemy.follow(pl)
+  enemy.follow(player)

 module()


Notify only on error when saving settings

--- assets/scripts/app/controllers.coffee
+++ assets/scripts/app/controllers.coffee
@@ -57,13 +57,7 @@
   settings: Ember.computed.alias('model.settings')

   save: ->
-    @set('saving', true)
-    self = this
-    @get('model').saveSettings(@get('settings')).then ->
-      self.set('saving', false)
-      Travis.flash(success: 'Settings were saved successfully')
-    , ->
-      self.set('saving', false)
+    @get('model').saveSettings(@get('settings')).then null, ->
       Travis.flash(error: 'There was an error while saving settings. Please try again.')

 require 'controllers/accounts'


Avoid extra query caused by unsaved event codes

Since not all event codes are saved (for compatibility reasons), such
event codes (e.g. "2 PERIODIC") causes a new param to be created which
results in a DB query to perform clear() operation.

--- lib/session.coffee
+++ lib/session.coffee
@@ -165,7 +165,11 @@

     toClear = null
     for p in params
-      toClear = device.set(sessionContext.deviceData, p[0], p[1], p[2], toClear)
+      # Don't need to clear wildcards for Events
+      if p[0][0] == 'Events'
+        device.set(sessionContext.deviceData, p[0], p[1], p[2])
+      else
+        toClear = device.set(sessionContext.deviceData, p[0], p[1], p[2], toClear)

     clear(sessionContext, toClear, (err) ->
       return callback(err, {name: 'InformResponse'})


dash: lovely improvement

dash: lovely improvement

Conflicts:

	node_modules_koding/sinkrow/src/sinkrow/index.coffee

--- node_modules_koding/sinkrow/src/sinkrow/index.coffee
+++ node_modules_koding/sinkrow/src/sinkrow/index.coffee
@@ -10,8 +10,7 @@
 @dash =(args, cb)->
   [cb, args] = [args, cb]  if 'function' is typeof args
   {length} = args
-  if length is 0
-    process.nextTick cb
+  if length is 0 then process.nextTick cb
   else
     count = 0
     args.fin =-> if ++count is length then !!cb() or yes else no


Add test for unclaimed devices

Add test for unclaimed devices

--- integration/rest-spec.coffee
+++ integration/rest-spec.coffee
@@ -241,3 +241,43 @@
           request:
             uuid: 'invalid-uuid'
         }
+
+  describe 'GET /unclaimeddevices', ->
+    describe 'when called with a valid request', ->
+      beforeEach (done) ->
+        pathname = "/unclaimeddevices"
+        uri = url.format protocol: @config.protocol, hostname: @config.server, port: @config.port, pathname: pathname
+        auth = user: @config.uuid, pass: @config.token
+        request.get uri, auth: auth,  (error) =>
+          return done error if error?
+          @conx.once 'message', (@message) =>
+            done()
+
+      it 'should send a "localdevices" message', ->
+        expect(@message.topic).to.deep.equal 'localdevices'
+        expect(@message.payload).to.deep.equal {
+          fromIp: '127.0.0.1'
+          fromUuid: "66b2928b-a317-4bc3-893e-245946e9672a"
+          request: {}
+        }
+
+    describe 'when called with an invalid request', ->
+      beforeEach (done) ->
+        pathname = "/unclaimeddevices"
+        query = uuid: 'invalid-uuid'
+        uri = url.format protocol: @config.protocol, hostname: @config.server, port: @config.port, pathname: pathname
+        auth = user: @config.uuid, pass: @config.token
+        request.get uri, auth: auth, qs: query,  (error) =>
+          return done error if error?
+          @conx.once 'message', (@message) =>
+            done()
+
+      it 'should send a "localdevices-error" message', ->
+        expect(@message.topic).to.deep.equal 'localdevices-error'
+        expect(@message.payload).to.deep.equal {
+          fromUuid: "66b2928b-a317-4bc3-893e-245946e9672a"
+          fromIp: "127.0.0.1"
+          error: "Devices not found"
+          request:
+            uuid: 'invalid-uuid'
+        }


cleaning up

cleaning up

--- lib/wd-sync.coffee
+++ lib/wd-sync.coffee
@@ -8,24 +8,29 @@
     include: '*'
     exclude: [
       'getOpts'
-      , 'element' #TODO check if not used directly
+      , 'element' #TODO check if not directly used
     ]
   }

 wdSync =
   # similar to wd
   remote: (args...) ->
-    # lookink for sync mode
+
+    # extracting mode from args
     mode = 'sync'
     args = args.filter (arg) ->
       if arg.mode?
         mode = arg.mode
         false
       else true
+
     browser = wd.remote(args...)
+
+    # patching browser
     options = buildOptions( mode )
     MakeSync browser, options
-    browser
+
+    return browser

   # retrieve the browser currently in use
   # useful when writting helpers


fixed test names

fixed test names

--- tests/basic.coffee
+++ tests/basic.coffee
@@ -8,7 +8,7 @@
   post = posts.findOne postId
   test.equal post.updateCount, 2

-Tinytest.add 'computedFields - external dependencies', (test) ->
+Tinytest.add 'ComputedFields - external dependencies', (test) ->
   posts = new Mongo.Collection null
   authors = new Mongo.Collection null

@@ -47,7 +47,7 @@
   test.equal author.postCount, 0

-Tinytest.add 'computedFields - simple field', (test) ->
+Tinytest.add 'ComputedFields - simple field', (test) ->
   posts = new Mongo.Collection null
   authors = new Mongo.Collection null


Modified datasources.coffee: -- Refactored front-end auth code as requested -- Added ability to pass in custom url

--- frontend/src/js/datasources.coffee
+++ frontend/src/js/datasources.coffee
@@ -116,6 +116,7 @@
         }
         @lastCall = 0
         @messages = []
+        @getJSON = $.getJSON('/api/twitter/search/', @params)

     getMessages: (callback)->
         now = (new Date()).getTime()
@@ -124,7 +125,7 @@
                 setTimeout((=> callback(@messages)), 0)
         else
             @lastCall = (new Date()).getTime()
-            $.getJSON('/api/twitter/search/', @params)
+            @getJSON
                 .success((data)=>
                     if data.statuses.length
                         @messages = data.statuses.concat(@messages)
@@ -157,82 +158,18 @@
                 )

-class @Fontana.datasources.TwitterSearchFA
+class @Fontana.datasources.TwitterSearchFA extends @Fontana.datasources.TwitterSearch
     ###
-    Same as above but allows custom HTTP service to be passed to it.
-    Useful if you want to use OAuth.io based frontend authentication
-    Any authenticated http service should work, e.g angular resources
-    Just needs to be authenticated, i.e bearer-token or other authentication header set first
-
-    Example:
-
-        ```CoffeeScript
-        $ ->
-            settings =
-                transition: 'tilt-scroll' #Check the twitter fontana plugin page for a list of anim effects
-            q = '#bestEventEver' #twitter search query
-            container = $('.fontana')
-
-            OAuth.initialize('your oauth.io public key here')
-            OAuth.popup 'twitter', (err, res)->
-                if visualizer
-                    visualizer.stop()
-                datasource = new Fontana.datasources.TwitterSearchFA(q, res)
-                visualizer = new Fontana.Visualizer(container, datasource)
-                visualizer.start(settings)
-                return
-        ```
+    Same as the Twitter search datasource but allows:
+    -- Different twitter api url
+    -- Uses an authenticated http service passed in,
+     such as an authenticated OAuth.io response, but others with the correct headers set should work as well
     ###
-    min_interval = 60000 * 15 / 180
-
-    constructor: (@q, @http)->
-        @params = {
-            since_id: 1
-            q: @q
-            result_type: 'recent'
-        }
-        @lastCall = 0
-        @messages = []
-
-    getMessages: (callback)->
-        now = (new Date()).getTime()
-        if now - @lastCall < min_interval
-            if callback
-                setTimeout((=> callback(@messages)), 0)
-        else
-            @lastCall = (new Date()).getTime()
-            @http.get(
-                url: "https://api.twitter.com/1.1/search/tweets.json"
-                data: @params
-                dataType: 'json')
-                    .success((data)=>
-                        if data.statuses.length
-                            @messages = data.statuses.concat(@messages)
-                            @params['since_id'] = @messages[0].id_str
-                        if callback
-                            if @messages.length
-                                callback(@messages)
-                            else
-                                callback([
-                                    id: (new Date()).getTime()
-                                    created_at: new Date().toString()
-                                    text: 'Your search term returned no Tweets :('
-                                    user:
-                                        name: 'Twitter Fontana'
-                                        screen_name: 'twitterfontana'
-                                        profile_image_url: '/img/avatar.png'
-                                ])
-                    )
-                    .error(->
-                        if callback
-                            callback([
-                                id: (new Date()).getTime()
-                                created_at: new Date().toString()
-                                text: 'Error fetching tweets :('
-                                user:
-                                    name: 'Twitter Fontana'
-                                    screen_name: 'twitterfontana'
-                                    profile_image_url: '/img/avatar.png'
-                            ])
-                    )
-
+    constructor: (@q, @http, @url)->
+        super(@q)
+        if !@url?
+            @url = "https://api.twitter.com/1.1/search/tweets.json"
+        @getJSON = @http.get(
+            url: @url
+            data: @params
+            dataType: 'json')


Fix directory build task

Fix directory build task

--- tasks/coffee_build.coffee
+++ tasks/coffee_build.coffee
@@ -28,21 +28,23 @@

 buildToDirectory = (grunt, options, f) ->
   cwd = f.orig.cwd or '.'
-  outFile = f.dest
-  outDir = path.dirname(outFile)
-
-  if /\.coffee$/.test(outFile)
-    outFile = outFile.replace(/\.coffee$/, '.js')
+  outDir = f.dest
+
+  if not grunt.file.exists(outDir)
+    grunt.file.mkdir(outDir)

   f.src.forEach (file) ->
+    file = path.join(cwd, file)
     if not grunt.file.exists(file)
       grunt.log.warn('Source file "' + file + '" not found.')
       return
-    if /\.js/.test(file)
+    outFile = path.join(outDir, path.relative(cwd, file))
+    if /\.js/.test(outFile)
       # plain js, just copy to the output dir
       grunt.file.copy(file, outFile)
       grunt.log.writeln("Copied #{file} to #{outFile}")
       return
+    outFile = outFile.replace(/\.coffee$/, '.js')
     entry = buildCache.dir[file]
     mt = mtime(file)
     if mt != entry?.mtime or outFile not of entry?.generated


fix #188: don't assign to result

fix #188: don't assign to result

--- app/context.coffee
+++ app/context.coffee
@@ -394,7 +394,6 @@
     string = "(#{string}).apply(this);"
   _.each var_names, (name) ->
     ctx.repl_vars[name] ?= undefined
-  result = null
   (->
     `with (ctx.scope) { with (ctx.repl_vars) {`
     _capture_context = (ctx, fn) ->
@@ -402,11 +401,9 @@
       (args...) ->
         restoring_context => fn.apply @, args

-    result = eval string
+    return eval string
     `}}`
   ).call ctx
-
-  result

 eval_in_context = (run_context, string) ->


Update modal.coffee

Update modal.coffee

--- vendor/assets/javascripts/mice/modal.coffee
+++ vendor/assets/javascripts/mice/modal.coffee
@@ -151,7 +151,7 @@

       @$backdrop.addClass('in')

-      return if !callback
+      return unless callback

       if doAnimate
         @$backdrop.one('bsTransitionEnd', callback).emulateTransitionEnd(150)


environment/flux: minor change

environment/flux: minor change

--- client/app/lib/flux/environment/actions.coffee
+++ client/app/lib/flux/environment/actions.coffee
@@ -18,12 +18,7 @@
 requirementsParser = require 'stacks/views/stacks/requirementsparser'
 { jsonToYaml } = require 'stacks/views/stacks/yamlutils'

-
-
-_eventsCache =
-  machine    : {}
-  stack      : no
-
+_eventsCache = { machine: {}, stack: no }

 _bindMachineEvents = (environmentData) ->


More legible line length

More legible line length

--- client/apps/edit/components/admin/index.coffee
+++ client/apps/edit/components/admin/index.coffee
@@ -48,28 +48,77 @@
   render: ->
     div { className: 'edit-admin' },

-      section { className: 'edit-admin--verticals-tags' + @getActiveSection 'verticals-tags' },
-        printTitle section: 'Verticals & Tagging', className: 'verticals-tags', onClick: @setActiveSection
+      section {
+        className: 'edit-admin--verticals-tags' + @getActiveSection 'verticals-tags'
+      },
+        printTitle {
+          section: 'Verticals & Tagging'
+          className: 'verticals-tags'
+          onClick: @setActiveSection
+        }
         if @isActiveSection 'verticals-tags'
-          VerticalsTags {article: @props.article, onChange: @onChange}
+          VerticalsTags {
+            article: @props.article
+            onChange: @onChange
+          }

-      section { className: 'edit-admin--article' + @getActiveSection 'article' },
-        printTitle section: 'Article', className: 'article', onClick: @setActiveSection
+      section {
+        className: 'edit-admin--article' + @getActiveSection 'article'
+      },
+        printTitle {
+          section: 'Article'
+          className: 'article'
+          onClick: @setActiveSection
+        }
         if @isActiveSection 'article'
-          Article {article: @props.article, channel: @props.channel, onChange: @onChange}
+          Article {
+            article: @props.article
+            channel: @props.channel
+            onChange: @onChange
+        }

-      section { className: 'edit-admin--featuring' + @getActiveSection 'featuring' },
-        printTitle section:  'Featuring', className: 'featuring', onClick: @setActiveSection
+      section {
+        className: 'edit-admin--featuring' + @getActiveSection 'featuring'
+      },
+        printTitle {
+          section:  'Featuring'
+          className: 'featuring'
+          onClick: @setActiveSection
+        }
         if @isActiveSection 'featuring'
-          Featuring {article: @props.article, channel: @props.channel, onChange: @onChange}
+          Featuring {
+            article: @props.article
+            channel: @props.channel
+            onChange: @onChange
+          }

       if @props.channel.hasFeature 'superArticle'
-        section { className: 'edit-admin--super-article' + @getActiveSection 'super-article' },
-          printTitle section: 'Super Article', className: 'super-article', onClick: @setActiveSection
+        section {
+          className: 'edit-admin--super-article' + @getActiveSection 'super-article'
+        },
+          printTitle {
+            section: 'Super Article'
+            className: 'super-article'
+            onClick: @setActiveSection
+          }
           if @isActiveSection 'super-article'
-            SuperArticle {article: @props.article, channel: @props.channel, onChange: @onChange}
+            SuperArticle {
+              article: @props.article
+              channel: @props.channel
+              onChange: @onChange
+            }

-      section { className: 'edit-admin--additional-appearances' + @getActiveSection 'additional-appearances' },
-        printTitle section: 'Additional Appearances', className: 'additional-appearances', onClick: @setActiveSection
+      section {
+        className: 'edit-admin--additional-appearances' + @getActiveSection 'additional-appearances'
+      },
+        printTitle {
+          section: 'Additional Appearances'
+          className: 'additional-appearances'
+          onClick: @setActiveSection
+        }
         if @isActiveSection 'additional-appearances'
-          Appearances {article: @props.article, channel: @props.channel, onChange: @onChange}+          Appearances {
+            article: @props.article
+            channel: @props.channel
+            onChange: @onChange
+          }


try the defaults

try the defaults

--- web.coffee
+++ web.coffee
@@ -13,8 +13,8 @@
 )

 multerConfig = {}
-if process.env.NODE_ENV == 'production'
-	multerConfig = {dest: '/var/tmp'}
+#if process.env.NODE_ENV == 'production'
+#	multerConfig = {dest: '/var/tmp'}

 app = express()
 	.use(morgan('combined'))


Start using editor settings and change variable names to prevent name collisions.

--- client/ide/workspace/panes/settingspane.coffee
+++ client/ide/workspace/panes/settingspane.coffee
@@ -39,11 +39,17 @@
       callback           : (state) -> console.log state

     @keyboardHandler     = new KDSelectBox
+      selectOptions      : __editorSettings.keyboardHandlers
     @softWrap            = new KDSelectBox
+      selectOptions      : __editorSettings.softWrapOptions
     @syntax              = new KDSelectBox
-    @fontSize            = new KDSelectBox
-    @theme               = new KDSelectBox
-    @tabSize             = new KDSelectBox
+      selectOptions      : __editorSettings.getSyntaxOptions()
+    @editorFontSize      = new KDSelectBox
+      selectOptions      : __editorSettings.fontSizes
+    @editorTheme         = new KDSelectBox
+      selectOptions      : __editorSettings.themes
+    @editorTabSize       = new KDSelectBox
+      selectOptions      : __editorSettings.tabSizes

     @shortcuts           = new KDCustomHTMLView
       tagName            : "a"
@@ -68,9 +74,9 @@

Soft wrap           {{> @softWrap}}

Syntax              {{> @syntax}}

Key binding         {{> @keyboardHandler}}

-
Font                {{> @fontSize}}

-
Theme               {{> @theme}}

-
Tab size            {{> @tabSize}}

+
Font                {{> @editorFontSize}}

+
Theme               {{> @editorTheme}}

+
Tab size            {{> @editorTabSize}}

{{> @shortcuts}}

Open Recent Files                       {{> @openRecentFiles}}


code quality

code quality

--- client/landing/app/MainApp/kodingrouter.coffee
+++ client/landing/app/MainApp/kodingrouter.coffee
@@ -36,7 +36,7 @@
     slugRe = /^(.+)?(#\{slug\})(.+)?$/
     re = RegExp slugTemplate.replace slugRe, (tmp, begin, slug, end)->
       "^#{begin ? ''}(.*)#{end ? ''}$"
-    str.match(re)[1]
+    str.match(re)?[1]

   openContent:(name, section, state, route)->
     appManager.tell section, 'createContentDisplay', state, (contentDisplay)=>


Added extra height to new answer page

Added extra height to new answer page

--- app/assets/javascripts/answers.coffee
+++ app/assets/javascripts/answers.coffee
@@ -4,8 +4,10 @@
       url = $(this).data("link")
       window.open(url, "_blank")
   new: ->
-    new_height = $('.content-wrapper').height() + $('#test-results').height() +
-      $('#error_explanation').height()
+    new_height = $('.content-wrapper').height() +
+      $('#test-results').height() +
+      $('#error_explanation').height() +
+      100
     $('.content-wrapper').height(new_height)

     $("a").preventDefault


updating article route

updating article route

--- app/assets/javascripts/ems/ems.coffee
+++ app/assets/javascripts/ems/ems.coffee
@@ -35,7 +35,7 @@
   # article routes
   @route '/articles/:category/new', 'articles#new', resource: 'articles', action: 'new'
   @route '/articles/:category/:id/edit', 'articles#edit', resource: 'articles', action: 'edit'
-  @route '/articles/:category', 'articles#list', resource: 'articles', action: 'edit'
+  @route '/articles/:category', 'articles#index', resource: 'articles', action: 'edit'

   # news routes
   @route '/news/:category/new', 'news#new', resource: 'news', action: 'new'