{"action":"created","comment":{"url":"https://api.github.com/repos/vizorvr/vizor/pulls/comments/74050604","id":74050604,"diff_hunk":"@@ -113,40 +107,34 @@ AssetService.prototype.findByPath = function(path) {\n }\n \n AssetService.prototype.save = function(data, user) {\n-\tvar that = this;\n+\tvar that = this\n \n \treturn this.findByPath(data.path)\n \t.then(function(asset) {\n-\t\tif (!asset)\n-\t\t\tasset = new that._model(data);\n-\n-\t\tasset._creator = user.id;\n-\t\tasset.updatedAt = Date.now();\n-\n-\t\tif (data.tags)\n-\t\t\tasset.tags = data.tags\n-\n-\t\tif (data.previewUrlSmall)\n-\t\t\tasset.previewUrlSmall = data.previewUrlSmall\n+\t\tif (!asset) {\n+\t\t\tasset = new that._model(data)\n+\t\t\tasset._creator = user.id\n+\t\t}\n \n-\t\tif (data.previewUrlLarge)\n-\t\t\tasset.previewUrlLarge = data.previewUrlLarge\n+\t\t// update model with stuff from data\n+\t\t_.assign(asset, data)","path":"services/assetService.js","position":155,"original_position":155,"commit_id":"3217e4c45c4fe31de30f6f12c6e1ffe254f6ea70","original_commit_id":"3217e4c45c4fe31de30f6f12c6e1ffe254f6ea70","user":{"login":"gmarinov","id":14101296,"avatar_url":"https://avatars.githubusercontent.com/u/14101296?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarinov","html_url":"https://github.com/gmarinov","followers_url":"https://api.github.com/users/gmarinov/followers","following_url":"https://api.github.com/users/gmarinov/following{/other_user}","gists_url":"https://api.github.com/users/gmarinov/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarinov/subscriptions","organizations_url":"https://api.github.com/users/gmarinov/orgs","repos_url":"https://api.github.com/users/gmarinov/repos","events_url":"https://api.github.com/users/gmarinov/events{/privacy}","received_events_url":"https://api.github.com/users/gmarinov/received_events","type":"User","site_admin":false},"body":"so passing data with existing but empty keys will now overwrite the asset? double-checking this is desired.","created_at":"2016-08-09T12:48:12Z","updated_at":"2016-08-09T12:48:12Z","html_url":"https://github.com/vizorvr/vizor/pull/1819#discussion_r74050604","pull_request_url":"https://api.github.com/repos/vizorvr/vizor/pulls/1819","_links":{"self":{"href":"https://api.github.com/repos/vizorvr/vizor/pulls/comments/74050604"},"html":{"href":"https://github.com/vizorvr/vizor/pull/1819#discussion_r74050604"},"pull_request":{"href":"https://api.github.com/repos/vizorvr/vizor/pulls/1819"}}},"pull_request":{"url":"https://api.github.com/repos/vizorvr/vizor/pulls/1819","id":78315798,"html_url":"https://github.com/vizorvr/vizor/pull/1819","diff_url":"https://github.com/vizorvr/vizor/pull/1819.diff","patch_url":"https://github.com/vizorvr/vizor/pull/1819.patch","issue_url":"https://api.github.com/repos/vizorvr/vizor/issues/1819","number":1819,"state":"open","locked":false,"title":"Presets to Patch, Patches in db, drag & drop Entities (and Components); resolves #1766","user":{"login":"kschzt","id":293426,"avatar_url":"https://avatars.githubusercontent.com/u/293426?v=3","gravatar_id":"","url":"https://api.github.com/users/kschzt","html_url":"https://github.com/kschzt","followers_url":"https://api.github.com/users/kschzt/followers","following_url":"https://api.github.com/users/kschzt/following{/other_user}","gists_url":"https://api.github.com/users/kschzt/gists{/gist_id}","starred_url":"https://api.github.com/users/kschzt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kschzt/subscriptions","organizations_url":"https://api.github.com/users/kschzt/orgs","repos_url":"https://api.github.com/users/kschzt/repos","events_url":"https://api.github.com/users/kschzt/events{/privacy}","received_events_url":"https://api.github.com/users/kschzt/received_events","type":"User","site_admin":false},"body":"- Improve auto-layout of entities in root patch\r\n- Rename Presets to Patches\r\n- Import Patches to DB\r\n- Read system Patches list from db \r\n- Drag & drop of entities into scene\r\n- Open selected entity patch in program mode\r\n- Select entity in scene when selecting in program mode\r\n- Use entity.plugin instead of graph.plugin on patches that have a single `object3d` output\r\n- Improve GraphAnalyser\r\n- Move the activation of a graph from TreeView to editor\r\n- Always drop entities into root graph\r\n- migration scripts\r\n-- move system patches to db\r\n-- fix patch paths in db\r\n-- change Object patches to use Entity or EntityComponent\r\n\r\nWill clean up the commit log in the end.","created_at":"2016-07-21T13:29:53Z","updated_at":"2016-08-09T12:48:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4959b80600e056b84ca1e7d24756d151f26eb95f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/vizorvr/vizor/pulls/1819/commits","review_comments_url":"https://api.github.com/repos/vizorvr/vizor/pulls/1819/comments","review_comment_url":"https://api.github.com/repos/vizorvr/vizor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vizorvr/vizor/issues/1819/comments","statuses_url":"https://api.github.com/repos/vizorvr/vizor/statuses/3217e4c45c4fe31de30f6f12c6e1ffe254f6ea70","head":{"label":"vizorvr:cms-patches-nocomponentdrop","ref":"cms-patches-nocomponentdrop","sha":"3217e4c45c4fe31de30f6f12c6e1ffe254f6ea70","user":{"login":"vizorvr","id":10456166,"avatar_url":"https://avatars.githubusercontent.com/u/10456166?v=3","gravatar_id":"","url":"https://api.github.com/users/vizorvr","html_url":"https://github.com/vizorvr","followers_url":"https://api.github.com/users/vizorvr/followers","following_url":"https://api.github.com/users/vizorvr/following{/other_user}","gists_url":"https://api.github.com/users/vizorvr/gists{/gist_id}","starred_url":"https://api.github.com/users/vizorvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vizorvr/subscriptions","organizations_url":"https://api.github.com/users/vizorvr/orgs","repos_url":"https://api.github.com/users/vizorvr/repos","events_url":"https://api.github.com/users/vizorvr/events{/privacy}","received_events_url":"https://api.github.com/users/vizorvr/received_events","type":"Organization","site_admin":false},"repo":{"id":29096746,"name":"vizor","full_name":"vizorvr/vizor","owner":{"login":"vizorvr","id":10456166,"avatar_url":"https://avatars.githubusercontent.com/u/10456166?v=3","gravatar_id":"","url":"https://api.github.com/users/vizorvr","html_url":"https://github.com/vizorvr","followers_url":"https://api.github.com/users/vizorvr/followers","following_url":"https://api.github.com/users/vizorvr/following{/other_user}","gists_url":"https://api.github.com/users/vizorvr/gists{/gist_id}","starred_url":"https://api.github.com/users/vizorvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vizorvr/subscriptions","organizations_url":"https://api.github.com/users/vizorvr/orgs","repos_url":"https://api.github.com/users/vizorvr/repos","events_url":"https://api.github.com/users/vizorvr/events{/privacy}","received_events_url":"https://api.github.com/users/vizorvr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vizorvr/vizor","description":"Vizor is a platform for creating and sharing WebVR content","fork":false,"url":"https://api.github.com/repos/vizorvr/vizor","forks_url":"https://api.github.com/repos/vizorvr/vizor/forks","keys_url":"https://api.github.com/repos/vizorvr/vizor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vizorvr/vizor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vizorvr/vizor/teams","hooks_url":"https://api.github.com/repos/vizorvr/vizor/hooks","issue_events_url":"https://api.github.com/repos/vizorvr/vizor/issues/events{/number}","events_url":"https://api.github.com/repos/vizorvr/vizor/events","assignees_url":"https://api.github.com/repos/vizorvr/vizor/assignees{/user}","branches_url":"https://api.github.com/repos/vizorvr/vizor/branches{/branch}","tags_url":"https://api.github.com/repos/vizorvr/vizor/tags","blobs_url":"https://api.github.com/repos/vizorvr/vizor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vizorvr/vizor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vizorvr/vizor/git/refs{/sha}","trees_url":"https://api.github.com/repos/vizorvr/vizor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vizorvr/vizor/statuses/{sha}","languages_url":"https://api.github.com/repos/vizorvr/vizor/languages","stargazers_url":"https://api.github.com/repos/vizorvr/vizor/stargazers","contributors_url":"https://api.github.com/repos/vizorvr/vizor/contributors","subscribers_url":"https://api.github.com/repos/vizorvr/vizor/subscribers","subscription_url":"https://api.github.com/repos/vizorvr/vizor/subscription","commits_url":"https://api.github.com/repos/vizorvr/vizor/commits{/sha}","git_commits_url":"https://api.github.com/repos/vizorvr/vizor/git/commits{/sha}","comments_url":"https://api.github.com/repos/vizorvr/vizor/comments{/number}","issue_comment_url":"https://api.github.com/repos/vizorvr/vizor/issues/comments{/number}","contents_url":"https://api.github.com/repos/vizorvr/vizor/contents/{+path}","compare_url":"https://api.github.com/repos/vizorvr/vizor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vizorvr/vizor/merges","archive_url":"https://api.github.com/repos/vizorvr/vizor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vizorvr/vizor/downloads","issues_url":"https://api.github.com/repos/vizorvr/vizor/issues{/number}","pulls_url":"https://api.github.com/repos/vizorvr/vizor/pulls{/number}","milestones_url":"https://api.github.com/repos/vizorvr/vizor/milestones{/number}","notifications_url":"https://api.github.com/repos/vizorvr/vizor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vizorvr/vizor/labels{/name}","releases_url":"https://api.github.com/repos/vizorvr/vizor/releases{/id}","deployments_url":"https://api.github.com/repos/vizorvr/vizor/deployments","created_at":"2015-01-11T15:54:34Z","updated_at":"2016-08-03T03:02:03Z","pushed_at":"2016-08-09T11:55:57Z","git_url":"git://github.com/vizorvr/vizor.git","ssh_url":"git@github.com:vizorvr/vizor.git","clone_url":"https://github.com/vizorvr/vizor.git","svn_url":"https://github.com/vizorvr/vizor","homepage":"http://vizor.io","size":56726,"stargazers_count":142,"watchers_count":142,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":257,"forks":27,"open_issues":257,"watchers":142,"default_branch":"develop"}},"base":{"label":"vizorvr:develop","ref":"develop","sha":"a46ebf9ba6f20cc089a44438c8fb4c6ef5caac3c","user":{"login":"vizorvr","id":10456166,"avatar_url":"https://avatars.githubusercontent.com/u/10456166?v=3","gravatar_id":"","url":"https://api.github.com/users/vizorvr","html_url":"https://github.com/vizorvr","followers_url":"https://api.github.com/users/vizorvr/followers","following_url":"https://api.github.com/users/vizorvr/following{/other_user}","gists_url":"https://api.github.com/users/vizorvr/gists{/gist_id}","starred_url":"https://api.github.com/users/vizorvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vizorvr/subscriptions","organizations_url":"https://api.github.com/users/vizorvr/orgs","repos_url":"https://api.github.com/users/vizorvr/repos","events_url":"https://api.github.com/users/vizorvr/events{/privacy}","received_events_url":"https://api.github.com/users/vizorvr/received_events","type":"Organization","site_admin":false},"repo":{"id":29096746,"name":"vizor","full_name":"vizorvr/vizor","owner":{"login":"vizorvr","id":10456166,"avatar_url":"https://avatars.githubusercontent.com/u/10456166?v=3","gravatar_id":"","url":"https://api.github.com/users/vizorvr","html_url":"https://github.com/vizorvr","followers_url":"https://api.github.com/users/vizorvr/followers","following_url":"https://api.github.com/users/vizorvr/following{/other_user}","gists_url":"https://api.github.com/users/vizorvr/gists{/gist_id}","starred_url":"https://api.github.com/users/vizorvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vizorvr/subscriptions","organizations_url":"https://api.github.com/users/vizorvr/orgs","repos_url":"https://api.github.com/users/vizorvr/repos","events_url":"https://api.github.com/users/vizorvr/events{/privacy}","received_events_url":"https://api.github.com/users/vizorvr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vizorvr/vizor","description":"Vizor is a platform for creating and sharing WebVR content","fork":false,"url":"https://api.github.com/repos/vizorvr/vizor","forks_url":"https://api.github.com/repos/vizorvr/vizor/forks","keys_url":"https://api.github.com/repos/vizorvr/vizor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vizorvr/vizor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vizorvr/vizor/teams","hooks_url":"https://api.github.com/repos/vizorvr/vizor/hooks","issue_events_url":"https://api.github.com/repos/vizorvr/vizor/issues/events{/number}","events_url":"https://api.github.com/repos/vizorvr/vizor/events","assignees_url":"https://api.github.com/repos/vizorvr/vizor/assignees{/user}","branches_url":"https://api.github.com/repos/vizorvr/vizor/branches{/branch}","tags_url":"https://api.github.com/repos/vizorvr/vizor/tags","blobs_url":"https://api.github.com/repos/vizorvr/vizor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vizorvr/vizor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vizorvr/vizor/git/refs{/sha}","trees_url":"https://api.github.com/repos/vizorvr/vizor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vizorvr/vizor/statuses/{sha}","languages_url":"https://api.github.com/repos/vizorvr/vizor/languages","stargazers_url":"https://api.github.com/repos/vizorvr/vizor/stargazers","contributors_url":"https://api.github.com/repos/vizorvr/vizor/contributors","subscribers_url":"https://api.github.com/repos/vizorvr/vizor/subscribers","subscription_url":"https://api.github.com/repos/vizorvr/vizor/subscription","commits_url":"https://api.github.com/repos/vizorvr/vizor/commits{/sha}","git_commits_url":"https://api.github.com/repos/vizorvr/vizor/git/commits{/sha}","comments_url":"https://api.github.com/repos/vizorvr/vizor/comments{/number}","issue_comment_url":"https://api.github.com/repos/vizorvr/vizor/issues/comments{/number}","contents_url":"https://api.github.com/repos/vizorvr/vizor/contents/{+path}","compare_url":"https://api.github.com/repos/vizorvr/vizor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vizorvr/vizor/merges","archive_url":"https://api.github.com/repos/vizorvr/vizor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vizorvr/vizor/downloads","issues_url":"https://api.github.com/repos/vizorvr/vizor/issues{/number}","pulls_url":"https://api.github.com/repos/vizorvr/vizor/pulls{/number}","milestones_url":"https://api.github.com/repos/vizorvr/vizor/milestones{/number}","notifications_url":"https://api.github.com/repos/vizorvr/vizor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vizorvr/vizor/labels{/name}","releases_url":"https://api.github.com/repos/vizorvr/vizor/releases{/id}","deployments_url":"https://api.github.com/repos/vizorvr/vizor/deployments","created_at":"2015-01-11T15:54:34Z","updated_at":"2016-08-03T03:02:03Z","pushed_at":"2016-08-09T11:55:57Z","git_url":"git://github.com/vizorvr/vizor.git","ssh_url":"git@github.com:vizorvr/vizor.git","clone_url":"https://github.com/vizorvr/vizor.git","svn_url":"https://github.com/vizorvr/vizor","homepage":"http://vizor.io","size":56726,"stargazers_count":142,"watchers_count":142,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":257,"forks":27,"open_issues":257,"watchers":142,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/vizorvr/vizor/pulls/1819"},"html":{"href":"https://github.com/vizorvr/vizor/pull/1819"},"issue":{"href":"https://api.github.com/repos/vizorvr/vizor/issues/1819"},"comments":{"href":"https://api.github.com/repos/vizorvr/vizor/issues/1819/comments"},"review_comments":{"href":"https://api.github.com/repos/vizorvr/vizor/pulls/1819/comments"},"review_comment":{"href":"https://api.github.com/repos/vizorvr/vizor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vizorvr/vizor/pulls/1819/commits"},"statuses":{"href":"https://api.github.com/repos/vizorvr/vizor/statuses/3217e4c45c4fe31de30f6f12c6e1ffe254f6ea70"}}}}
{"actor":{"display_login":"gmarinov"}}