{"action":"created","comment":{"url":"https://api.github.com/repos/Syncano/syncano-js/pulls/comments/48476828","id":48476828,"diff_hunk":"@@ -1,15 +1,30 @@\n import stampit from 'stampit';\n import models from './models';\n+import _ from 'lodash';\n \n /**\n  * Main Syncano object.\n  * @type {Syncano}\n  */\n-const Syncano = stampit();\n-\n-models.Instance.please().list().then((response) => {\n-    response.objects[0].delete();\n-    response.objects[0].save();\n-})\n+const Syncano = stampit()\n+  .init(({instance}) => {\n+    _.forEach(models, (model, name) => {\n+      instance[name] = stampit().compose(model).setBaseObject(this)();","path":"src/syncano.js","position":18,"original_position":18,"commit_id":"d12b7534601082e70100254c87e491b5024644fa","original_commit_id":"d12b7534601082e70100254c87e491b5024644fa","user":{"login":"jakubbilko","id":908399,"avatar_url":"https://avatars.githubusercontent.com/u/908399?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubbilko","html_url":"https://github.com/jakubbilko","followers_url":"https://api.github.com/users/jakubbilko/followers","following_url":"https://api.github.com/users/jakubbilko/following{/other_user}","gists_url":"https://api.github.com/users/jakubbilko/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubbilko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubbilko/subscriptions","organizations_url":"https://api.github.com/users/jakubbilko/orgs","repos_url":"https://api.github.com/users/jakubbilko/repos","events_url":"https://api.github.com/users/jakubbilko/events{/privacy}","received_events_url":"https://api.github.com/users/jakubbilko/received_events","type":"User","site_admin":false},"body":"If you don't use the `()` then syncano.Instance will return the factory, so you'll need to use it as `syncano.Instance()` ;)","created_at":"2015-12-28T12:33:37Z","updated_at":"2015-12-28T12:33:37Z","html_url":"https://github.com/Syncano/syncano-js/pull/66#discussion_r48476828","pull_request_url":"https://api.github.com/repos/Syncano/syncano-js/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/Syncano/syncano-js/pulls/comments/48476828"},"html":{"href":"https://github.com/Syncano/syncano-js/pull/66#discussion_r48476828"},"pull_request":{"href":"https://api.github.com/repos/Syncano/syncano-js/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/Syncano/syncano-js/pulls/66","id":54651539,"html_url":"https://github.com/Syncano/syncano-js/pull/66","diff_url":"https://github.com/Syncano/syncano-js/pull/66.diff","patch_url":"https://github.com/Syncano/syncano-js/pull/66.patch","issue_url":"https://api.github.com/repos/Syncano/syncano-js/issues/66","number":66,"state":"open","locked":false,"title":"[LIB-371] Base object init","user":{"login":"jakubbilko","id":908399,"avatar_url":"https://avatars.githubusercontent.com/u/908399?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubbilko","html_url":"https://github.com/jakubbilko","followers_url":"https://api.github.com/users/jakubbilko/followers","following_url":"https://api.github.com/users/jakubbilko/following{/other_user}","gists_url":"https://api.github.com/users/jakubbilko/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubbilko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubbilko/subscriptions","organizations_url":"https://api.github.com/users/jakubbilko/orgs","repos_url":"https://api.github.com/users/jakubbilko/repos","events_url":"https://api.github.com/users/jakubbilko/events{/privacy}","received_events_url":"https://api.github.com/users/jakubbilko/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-28T12:21:25Z","updated_at":"2015-12-28T12:33:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1625152e73aa17bb337b0821b78cf9d119580c6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Syncano/syncano-js/pulls/66/commits","review_comments_url":"https://api.github.com/repos/Syncano/syncano-js/pulls/66/comments","review_comment_url":"https://api.github.com/repos/Syncano/syncano-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Syncano/syncano-js/issues/66/comments","statuses_url":"https://api.github.com/repos/Syncano/syncano-js/statuses/d12b7534601082e70100254c87e491b5024644fa","head":{"label":"Syncano:LIB-371","ref":"LIB-371","sha":"d12b7534601082e70100254c87e491b5024644fa","user":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars.githubusercontent.com/u/6367703?v=3","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"repo":{"id":38018919,"name":"syncano-js","full_name":"Syncano/syncano-js","owner":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars.githubusercontent.com/u/6367703?v=3","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Syncano/syncano-js","description":"","fork":false,"url":"https://api.github.com/repos/Syncano/syncano-js","forks_url":"https://api.github.com/repos/Syncano/syncano-js/forks","keys_url":"https://api.github.com/repos/Syncano/syncano-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Syncano/syncano-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Syncano/syncano-js/teams","hooks_url":"https://api.github.com/repos/Syncano/syncano-js/hooks","issue_events_url":"https://api.github.com/repos/Syncano/syncano-js/issues/events{/number}","events_url":"https://api.github.com/repos/Syncano/syncano-js/events","assignees_url":"https://api.github.com/repos/Syncano/syncano-js/assignees{/user}","branches_url":"https://api.github.com/repos/Syncano/syncano-js/branches{/branch}","tags_url":"https://api.github.com/repos/Syncano/syncano-js/tags","blobs_url":"https://api.github.com/repos/Syncano/syncano-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Syncano/syncano-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Syncano/syncano-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Syncano/syncano-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Syncano/syncano-js/statuses/{sha}","languages_url":"https://api.github.com/repos/Syncano/syncano-js/languages","stargazers_url":"https://api.github.com/repos/Syncano/syncano-js/stargazers","contributors_url":"https://api.github.com/repos/Syncano/syncano-js/contributors","subscribers_url":"https://api.github.com/repos/Syncano/syncano-js/subscribers","subscription_url":"https://api.github.com/repos/Syncano/syncano-js/subscription","commits_url":"https://api.github.com/repos/Syncano/syncano-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Syncano/syncano-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Syncano/syncano-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Syncano/syncano-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Syncano/syncano-js/contents/{+path}","compare_url":"https://api.github.com/repos/Syncano/syncano-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Syncano/syncano-js/merges","archive_url":"https://api.github.com/repos/Syncano/syncano-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Syncano/syncano-js/downloads","issues_url":"https://api.github.com/repos/Syncano/syncano-js/issues{/number}","pulls_url":"https://api.github.com/repos/Syncano/syncano-js/pulls{/number}","milestones_url":"https://api.github.com/repos/Syncano/syncano-js/milestones{/number}","notifications_url":"https://api.github.com/repos/Syncano/syncano-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Syncano/syncano-js/labels{/name}","releases_url":"https://api.github.com/repos/Syncano/syncano-js/releases{/id}","created_at":"2015-06-25T00:40:56Z","updated_at":"2015-12-07T16:11:20Z","pushed_at":"2015-12-28T12:29:09Z","git_url":"git://github.com/Syncano/syncano-js.git","ssh_url":"git@github.com:Syncano/syncano-js.git","clone_url":"https://github.com/Syncano/syncano-js.git","svn_url":"https://github.com/Syncano/syncano-js","homepage":null,"size":6695,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":6,"default_branch":"master"}},"base":{"label":"Syncano:release/1.0.0","ref":"release/1.0.0","sha":"010e55676bca5e6ca40b5b83a0d9d2274d2c4944","user":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars.githubusercontent.com/u/6367703?v=3","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"repo":{"id":38018919,"name":"syncano-js","full_name":"Syncano/syncano-js","owner":{"login":"Syncano","id":6367703,"avatar_url":"https://avatars.githubusercontent.com/u/6367703?v=3","gravatar_id":"","url":"https://api.github.com/users/Syncano","html_url":"https://github.com/Syncano","followers_url":"https://api.github.com/users/Syncano/followers","following_url":"https://api.github.com/users/Syncano/following{/other_user}","gists_url":"https://api.github.com/users/Syncano/gists{/gist_id}","starred_url":"https://api.github.com/users/Syncano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Syncano/subscriptions","organizations_url":"https://api.github.com/users/Syncano/orgs","repos_url":"https://api.github.com/users/Syncano/repos","events_url":"https://api.github.com/users/Syncano/events{/privacy}","received_events_url":"https://api.github.com/users/Syncano/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Syncano/syncano-js","description":"","fork":false,"url":"https://api.github.com/repos/Syncano/syncano-js","forks_url":"https://api.github.com/repos/Syncano/syncano-js/forks","keys_url":"https://api.github.com/repos/Syncano/syncano-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Syncano/syncano-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Syncano/syncano-js/teams","hooks_url":"https://api.github.com/repos/Syncano/syncano-js/hooks","issue_events_url":"https://api.github.com/repos/Syncano/syncano-js/issues/events{/number}","events_url":"https://api.github.com/repos/Syncano/syncano-js/events","assignees_url":"https://api.github.com/repos/Syncano/syncano-js/assignees{/user}","branches_url":"https://api.github.com/repos/Syncano/syncano-js/branches{/branch}","tags_url":"https://api.github.com/repos/Syncano/syncano-js/tags","blobs_url":"https://api.github.com/repos/Syncano/syncano-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Syncano/syncano-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Syncano/syncano-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Syncano/syncano-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Syncano/syncano-js/statuses/{sha}","languages_url":"https://api.github.com/repos/Syncano/syncano-js/languages","stargazers_url":"https://api.github.com/repos/Syncano/syncano-js/stargazers","contributors_url":"https://api.github.com/repos/Syncano/syncano-js/contributors","subscribers_url":"https://api.github.com/repos/Syncano/syncano-js/subscribers","subscription_url":"https://api.github.com/repos/Syncano/syncano-js/subscription","commits_url":"https://api.github.com/repos/Syncano/syncano-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Syncano/syncano-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Syncano/syncano-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Syncano/syncano-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Syncano/syncano-js/contents/{+path}","compare_url":"https://api.github.com/repos/Syncano/syncano-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Syncano/syncano-js/merges","archive_url":"https://api.github.com/repos/Syncano/syncano-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Syncano/syncano-js/downloads","issues_url":"https://api.github.com/repos/Syncano/syncano-js/issues{/number}","pulls_url":"https://api.github.com/repos/Syncano/syncano-js/pulls{/number}","milestones_url":"https://api.github.com/repos/Syncano/syncano-js/milestones{/number}","notifications_url":"https://api.github.com/repos/Syncano/syncano-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Syncano/syncano-js/labels{/name}","releases_url":"https://api.github.com/repos/Syncano/syncano-js/releases{/id}","created_at":"2015-06-25T00:40:56Z","updated_at":"2015-12-07T16:11:20Z","pushed_at":"2015-12-28T12:29:09Z","git_url":"git://github.com/Syncano/syncano-js.git","ssh_url":"git@github.com:Syncano/syncano-js.git","clone_url":"https://github.com/Syncano/syncano-js.git","svn_url":"https://github.com/Syncano/syncano-js","homepage":null,"size":6695,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Syncano/syncano-js/pulls/66"},"html":{"href":"https://github.com/Syncano/syncano-js/pull/66"},"issue":{"href":"https://api.github.com/repos/Syncano/syncano-js/issues/66"},"comments":{"href":"https://api.github.com/repos/Syncano/syncano-js/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/Syncano/syncano-js/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/Syncano/syncano-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Syncano/syncano-js/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/Syncano/syncano-js/statuses/d12b7534601082e70100254c87e491b5024644fa"}}}}