{"action":"opened","issue":{"url":"https://api.github.com/repos/scottwrobinson/camo/issues/26","labels_url":"https://api.github.com/repos/scottwrobinson/camo/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/scottwrobinson/camo/issues/26/comments","events_url":"https://api.github.com/repos/scottwrobinson/camo/issues/26/events","html_url":"https://github.com/scottwrobinson/camo/issues/26","id":124229413,"number":26,"title":"`that.collectionName is not a function` on EmbeddedDocument","user":{"login":"ijsf","id":123868,"avatar_url":"https://avatars.githubusercontent.com/u/123868?v=3","gravatar_id":"","url":"https://api.github.com/users/ijsf","html_url":"https://github.com/ijsf","followers_url":"https://api.github.com/users/ijsf/followers","following_url":"https://api.github.com/users/ijsf/following{/other_user}","gists_url":"https://api.github.com/users/ijsf/gists{/gist_id}","starred_url":"https://api.github.com/users/ijsf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijsf/subscriptions","organizations_url":"https://api.github.com/users/ijsf/orgs","repos_url":"https://api.github.com/users/ijsf/repos","events_url":"https://api.github.com/users/ijsf/events{/privacy}","received_events_url":"https://api.github.com/users/ijsf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-29T15:52:11Z","updated_at":"2015-12-29T15:52:11Z","closed_at":null,"body":"I am having an issue when trying to create (and save) an `EmbeddedDocument`. I have the following class:\r\n\r\n    class Reminder extends camo.EmbeddedDocument\r\n    {\r\n      constructor()\r\n      {\r\n        super();\r\n        this.enabled = { type: Boolean, required: true };\r\n      }\r\n    }\r\n\r\nNow, when I create a `Reminder` instance that does not adhere to the above, e.g. the `enabled` property is missing, like in this example:\r\n\r\n    Reminder.create({}).save();\r\n\r\nI get the following error:\r\n\r\n    info: TypeError: that.collectionName is not a function\r\n\r\nThis is obviously an artifact of the new `collectionName` functionality in the `validate` function inside camo. Except, `collectionName` does not exist in `EmbeddedDocument` instances."}}