{"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/comments/60233173","id":60233173,"diff_hunk":"@@ -101,3 +101,220 @@ describe('ModelMethod', function() {\n       });\n   });\n });\n+\n+describe('ModelMethod - Loopback 2.0', function() {\n+  var userModel;\n+\n+  givenLB2Workspace = function(cb) {\n+    givenWorkspaceWithCustomDependencies('empty-server', {\n+      loopback: '^2.0.0',\n+      'loopback-datasource-juggler': '^2.0.0'\n+    }, cb);\n+  };\n+\n+  beforeEach(function(done) {\n+    givenLB2Workspace(done);\n+  });\n+  \n+  beforeEach(function(done) {\n+    ModelDefinition.create(\n+      {\n+        name: 'user',\n+        facetName: 'server'\n+      },\n+      function(err, result) {\n+        if (err) return done(err);\n+        userModel = result;\n+        done();\n+      });\n+  });\n+ \n+  it('correctly adds static method with isStatic flag', function(done) {\n+    ModelMethod.create(\n+      {\n+        modelId: userModel.id,\n+        name: 'testMethod',\n+        isStatic: true\n+      },\n+      function(err) {\n+        if (err) return done(err);\n+        userModel.methods(function(err, list) {\n+          if (err) return done(err);\n+          expect(list).to.have.length(1);\n+          expect(list[0]).to.have.property('name', 'testMethod');\n+          expect(list[0]).to.have.property('isStatic', true);\n+\n+          var cfg = new ConfigFile({ path: 'server/models/user.json' });\n+          cfg.load(function(err) {\n+            if (err) return done(err);\n+            var methods = cfg.data.methods;\n+            expect(methods).to.be.an('object');\n+            expect(methods).to.have.property('testMethod');\n+            expect(methods).to.not.have.property('prototype.testMethod');\n+            expect(methods.testMethod).to.have.property('isStatic', true);\n+            done();\n+          });\n+        });\n+      });\n+  });\n+\n+  it('correctly adds prototype method', function(done) {\n+    ModelMethod.create(\n+      {\n+        modelId: userModel.id,\n+        name: 'testMethod',\n+        isStatic: false\n+      },\n+      function(err) {\n+        if (err) return done(err);\n+        userModel.methods(function(err, list) {\n+          if (err) return done(err);\n+          expect(list).to.have.length(1);\n+          expect(list[0]).to.have.property('name', 'testMethod');\n+          expect(list[0]).to.have.property('isStatic', false);\n+\n+          var cfg = new ConfigFile({ path: 'server/models/user.json' });\n+          cfg.load(function(err) {\n+            if (err) return done(err);\n+            var methods = cfg.data.methods;\n+            expect(methods).to.be.an('object');\n+            expect(methods).to.have.property('testMethod');\n+            expect(methods).to.not.have.property('prototype.testMethod');\n+            expect(methods.testMethod).to.have.property('isStatic', false);\n+            done();\n+          });\n+        });\n+      });\n+  });\n+});\n+\n+describe('ModelMethod - Loopback 3.0', function() {\n+  var userModel;\n+\n+  givenLB3Workspace = function(cb) {\n+    givenWorkspaceWithCustomDependencies('empty-server', {\n+      loopback: '^3.0.0-alpha.1' \n+    }, cb);\n+  };\n+\n+  beforeEach(function(done) {\n+    givenLB3Workspace(done);\n+  });\n+  \n+  beforeEach(function(done) {\n+    ModelDefinition.create(\n+      {\n+        name: 'user',\n+        facetName: 'server'\n+      },\n+      function(err, result) {\n+        if (err) return done(err);\n+        userModel = result;\n+        done();\n+      });\n+  });\n+ \n+  it('add static method without isStatic flag to model definition', function(done) {\n+    ModelMethod.create(\n+      {\n+        modelId: userModel.id,\n+        name: 'testMethod',\n+        isStatic: true\n+      },\n+      function(err) {\n+        if (err) return done(err);\n+        userModel.methods(function(err, list) {\n+          if (err) return done(err);\n+          expect(list).to.have.length(1);\n+          expect(list[0]).to.have.property('name', 'testMethod');\n+          expect(list[0]).to.not.have.property('isStatic');\n+\n+          var cfg = new ConfigFile({ path: 'server/models/user.json' });\n+          cfg.load(function(err) {\n+            if (err) return done(err);\n+            var methods = cfg.data.methods;\n+            expect(methods).to.be.an('object');\n+            expect(methods).to.have.property('testMethod');\n+            expect(methods).to.not.have.property('prototype.testMethod');\n+            expect(methods.testMethod).to.not.have.property('isStatic');\n+            done();\n+          });\n+        });\n+      });\n+  });\n+  \n+  it('add prototype method without isStatic flag to model definition', function(done) {\n+    ModelMethod.create(\n+      {\n+        modelId: userModel.id,\n+        name: 'prototype.testMethod',\n+        isStatic: false","path":"test/model-method.js","position":151,"original_position":151,"commit_id":"8aed8c66e2e47a075f7a2cca2b8977ea6aaf1d12","original_commit_id":"8aed8c66e2e47a075f7a2cca2b8977ea6aaf1d12","user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"body":"The test name says \"without isStatic flag\", but the test data does set the flag. PTAL","created_at":"2016-04-19T13:45:50Z","updated_at":"2016-04-19T13:45:50Z","html_url":"https://github.com/strongloop/loopback-workspace/pull/273#discussion_r60233173","pull_request_url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273","_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/comments/60233173"},"html":{"href":"https://github.com/strongloop/loopback-workspace/pull/273#discussion_r60233173"},"pull_request":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273"}}},"pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273","id":65692080,"html_url":"https://github.com/strongloop/loopback-workspace/pull/273","diff_url":"https://github.com/strongloop/loopback-workspace/pull/273.diff","patch_url":"https://github.com/strongloop/loopback-workspace/pull/273.patch","issue_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues/273","number":273,"state":"open","locked":false,"title":"Update project to remove isStatic flag","user":{"login":"0candy","id":14314570,"avatar_url":"https://avatars.githubusercontent.com/u/14314570?v=3","gravatar_id":"","url":"https://api.github.com/users/0candy","html_url":"https://github.com/0candy","followers_url":"https://api.github.com/users/0candy/followers","following_url":"https://api.github.com/users/0candy/following{/other_user}","gists_url":"https://api.github.com/users/0candy/gists{/gist_id}","starred_url":"https://api.github.com/users/0candy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0candy/subscriptions","organizations_url":"https://api.github.com/users/0candy/orgs","repos_url":"https://api.github.com/users/0candy/repos","events_url":"https://api.github.com/users/0candy/events{/privacy}","received_events_url":"https://api.github.com/users/0candy/received_events","type":"User","site_admin":false},"body":"Connect to https://github.com/strongloop-internal/scrum-loopback/issues/813\r\n\r\nOnly for LB 3.0","created_at":"2016-04-07T20:14:06Z","updated_at":"2016-04-19T13:45:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3acb935fb4ccdb5eee15bb7bb7d8be7b53f38e9b","assignee":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273/commits","review_comments_url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273/comments","review_comment_url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues/273/comments","statuses_url":"https://api.github.com/repos/strongloop/loopback-workspace/statuses/8aed8c66e2e47a075f7a2cca2b8977ea6aaf1d12","head":{"label":"strongloop:update_remote_method","ref":"update_remote_method","sha":"8aed8c66e2e47a075f7a2cca2b8977ea6aaf1d12","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":9530789,"name":"loopback-workspace","full_name":"strongloop/loopback-workspace","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/loopback-workspace","description":"Manage a directory of Loopback Projects for a user, team, or organization","fork":false,"url":"https://api.github.com/repos/strongloop/loopback-workspace","forks_url":"https://api.github.com/repos/strongloop/loopback-workspace/forks","keys_url":"https://api.github.com/repos/strongloop/loopback-workspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/loopback-workspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/loopback-workspace/teams","hooks_url":"https://api.github.com/repos/strongloop/loopback-workspace/hooks","issue_events_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/loopback-workspace/events","assignees_url":"https://api.github.com/repos/strongloop/loopback-workspace/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/loopback-workspace/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/loopback-workspace/tags","blobs_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/loopback-workspace/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/loopback-workspace/languages","stargazers_url":"https://api.github.com/repos/strongloop/loopback-workspace/stargazers","contributors_url":"https://api.github.com/repos/strongloop/loopback-workspace/contributors","subscribers_url":"https://api.github.com/repos/strongloop/loopback-workspace/subscribers","subscription_url":"https://api.github.com/repos/strongloop/loopback-workspace/subscription","commits_url":"https://api.github.com/repos/strongloop/loopback-workspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/loopback-workspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/loopback-workspace/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/loopback-workspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/loopback-workspace/merges","archive_url":"https://api.github.com/repos/strongloop/loopback-workspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/loopback-workspace/downloads","issues_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/loopback-workspace/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/loopback-workspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/loopback-workspace/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/loopback-workspace/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/loopback-workspace/deployments","created_at":"2013-04-18T20:12:34Z","updated_at":"2016-02-05T06:20:58Z","pushed_at":"2016-04-18T21:02:57Z","git_url":"git://github.com/strongloop/loopback-workspace.git","ssh_url":"git@github.com:strongloop/loopback-workspace.git","clone_url":"https://github.com/strongloop/loopback-workspace.git","svn_url":"https://github.com/strongloop/loopback-workspace","homepage":"http://loopback.io","size":1073,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":35,"forks":22,"open_issues":35,"watchers":18,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"bcb1dc85e3e3d2fcc986ff94e2f4684861c6f3f6","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":9530789,"name":"loopback-workspace","full_name":"strongloop/loopback-workspace","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/loopback-workspace","description":"Manage a directory of Loopback Projects for a user, team, or organization","fork":false,"url":"https://api.github.com/repos/strongloop/loopback-workspace","forks_url":"https://api.github.com/repos/strongloop/loopback-workspace/forks","keys_url":"https://api.github.com/repos/strongloop/loopback-workspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/loopback-workspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/loopback-workspace/teams","hooks_url":"https://api.github.com/repos/strongloop/loopback-workspace/hooks","issue_events_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/loopback-workspace/events","assignees_url":"https://api.github.com/repos/strongloop/loopback-workspace/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/loopback-workspace/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/loopback-workspace/tags","blobs_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/loopback-workspace/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/loopback-workspace/languages","stargazers_url":"https://api.github.com/repos/strongloop/loopback-workspace/stargazers","contributors_url":"https://api.github.com/repos/strongloop/loopback-workspace/contributors","subscribers_url":"https://api.github.com/repos/strongloop/loopback-workspace/subscribers","subscription_url":"https://api.github.com/repos/strongloop/loopback-workspace/subscription","commits_url":"https://api.github.com/repos/strongloop/loopback-workspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/loopback-workspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/loopback-workspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/loopback-workspace/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/loopback-workspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/loopback-workspace/merges","archive_url":"https://api.github.com/repos/strongloop/loopback-workspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/loopback-workspace/downloads","issues_url":"https://api.github.com/repos/strongloop/loopback-workspace/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/loopback-workspace/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/loopback-workspace/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/loopback-workspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/loopback-workspace/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/loopback-workspace/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/loopback-workspace/deployments","created_at":"2013-04-18T20:12:34Z","updated_at":"2016-02-05T06:20:58Z","pushed_at":"2016-04-18T21:02:57Z","git_url":"git://github.com/strongloop/loopback-workspace.git","ssh_url":"git@github.com:strongloop/loopback-workspace.git","clone_url":"https://github.com/strongloop/loopback-workspace.git","svn_url":"https://github.com/strongloop/loopback-workspace","homepage":"http://loopback.io","size":1073,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":35,"forks":22,"open_issues":35,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273"},"html":{"href":"https://github.com/strongloop/loopback-workspace/pull/273"},"issue":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/issues/273"},"comments":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/issues/273/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/pulls/273/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/loopback-workspace/statuses/8aed8c66e2e47a075f7a2cca2b8977ea6aaf1d12"}}}}