{"action":"created","comment":{"url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/comments/25438033","id":25438033,"diff_hunk":"@@ -95,47 +88,32 @@ module.exports = function(grunt) {\n       grunt.fail.warn(err);\n     }\n \n-    // load configuration file\n-    var config;\n-    try {\n-      config = require(path.resolve(options.config));\n-      grunt.log.ok('Loaded models configuration %j', options.config);\n-    } catch (e) {\n-      var err = new Error('Cannot load models configuration ' + options.config);\n-      err.origError = e;\n-      grunt.fail.warn(err);\n-    }\n+    var ds = app.dataSources[options.dataSource];\n+    ds.setMaxListeners(100); //squash warning, not sure if this is harmful\n \n     // Show Datasource\n-    grunt.log.ok('DataSource: %s', colors.blue(options.dataSource));\n+    grunt.log.ok('DataSource: %s', colors.blue(ds.name));\n \n     // line break\n     grunt.log.writeln('');\n \n-    // run autoupdate/automigrate for each model\n-    for (var model in config) {\n-      // ignore exclude model\n-      if (!_.contains(options.exclude, model)) {\n-        if (config[model].dataSource === options.dataSource) {\n-          var dataSource = app.dataSources[config[model].dataSource];\n-          // execute command\n-          logEvent('ok');\n-          grunt.log.writeln(model + ' ' + colors.green(options.method));\n-          dataSource[options.method](model, callback);\n-        }\n-        else {\n-          logEvent('ignored');\n-          grunt.log.writeln(model + ' ' + colors.grey('ignored') + ' -> DataSource: ' + colors.blue(config[model].dataSource));\n-          goToNext();\n-        }\n+    //collect models for data source.\n+    var models = _.select(ds.modelBuilder.models, function (m) {","path":"tasks/loopback_auto.js","position":97,"original_position":97,"commit_id":"45815198ec3002013070e7da60ff606a470dee69","original_commit_id":"45815198ec3002013070e7da60ff606a470dee69","user":{"login":"paulomcnally","id":181533,"avatar_url":"https://avatars.githubusercontent.com/u/181533?v=3","gravatar_id":"","url":"https://api.github.com/users/paulomcnally","html_url":"https://github.com/paulomcnally","followers_url":"https://api.github.com/users/paulomcnally/followers","following_url":"https://api.github.com/users/paulomcnally/following{/other_user}","gists_url":"https://api.github.com/users/paulomcnally/gists{/gist_id}","starred_url":"https://api.github.com/users/paulomcnally/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulomcnally/subscriptions","organizations_url":"https://api.github.com/users/paulomcnally/orgs","repos_url":"https://api.github.com/users/paulomcnally/repos","events_url":"https://api.github.com/users/paulomcnally/events{/privacy}","received_events_url":"https://api.github.com/users/paulomcnally/received_events","type":"User","site_admin":false},"body":"change **m** with **model**","created_at":"2015-02-26T16:00:37Z","updated_at":"2015-02-26T16:00:37Z","html_url":"https://github.com/paulomcnally/grunt-loopback-auto/pull/2#discussion_r25438033","pull_request_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/comments/25438033"},"html":{"href":"https://github.com/paulomcnally/grunt-loopback-auto/pull/2#discussion_r25438033"},"pull_request":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2","id":30060583,"html_url":"https://github.com/paulomcnally/grunt-loopback-auto/pull/2","diff_url":"https://github.com/paulomcnally/grunt-loopback-auto/pull/2.diff","patch_url":"https://github.com/paulomcnally/grunt-loopback-auto/pull/2.patch","issue_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/issues/2","number":2,"state":"open","locked":false,"title":"Lookup models using the datasource modelbuilder instead of cfg file","user":{"login":"jaminschubert","id":831303,"avatar_url":"https://avatars.githubusercontent.com/u/831303?v=3","gravatar_id":"","url":"https://api.github.com/users/jaminschubert","html_url":"https://github.com/jaminschubert","followers_url":"https://api.github.com/users/jaminschubert/followers","following_url":"https://api.github.com/users/jaminschubert/following{/other_user}","gists_url":"https://api.github.com/users/jaminschubert/gists{/gist_id}","starred_url":"https://api.github.com/users/jaminschubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaminschubert/subscriptions","organizations_url":"https://api.github.com/users/jaminschubert/orgs","repos_url":"https://api.github.com/users/jaminschubert/repos","events_url":"https://api.github.com/users/jaminschubert/events{/privacy}","received_events_url":"https://api.github.com/users/jaminschubert/received_events","type":"User","site_admin":false},"body":"Reached this approach through a discussion with the loopback developers.  You can read the exchange on the google group:\r\nhttps://groups.google.com/forum/#!searchin/loopbackjs/seth$20schubert/loopbackjs/dKOI4UHqfcU/JOoldrT38WQJ\r\n\r\n\r\n","created_at":"2015-02-26T09:09:08Z","updated_at":"2015-02-26T16:00:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05d8673a90d540c6b3056c225d50aca02d54af4e","assignee":{"login":"paulomcnally","id":181533,"avatar_url":"https://avatars.githubusercontent.com/u/181533?v=3","gravatar_id":"","url":"https://api.github.com/users/paulomcnally","html_url":"https://github.com/paulomcnally","followers_url":"https://api.github.com/users/paulomcnally/followers","following_url":"https://api.github.com/users/paulomcnally/following{/other_user}","gists_url":"https://api.github.com/users/paulomcnally/gists{/gist_id}","starred_url":"https://api.github.com/users/paulomcnally/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulomcnally/subscriptions","organizations_url":"https://api.github.com/users/paulomcnally/orgs","repos_url":"https://api.github.com/users/paulomcnally/repos","events_url":"https://api.github.com/users/paulomcnally/events{/privacy}","received_events_url":"https://api.github.com/users/paulomcnally/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2/commits","review_comments_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2/comments","review_comment_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/issues/2/comments","statuses_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/statuses/45815198ec3002013070e7da60ff606a470dee69","head":{"label":"kindlycare:ds-list","ref":"ds-list","sha":"45815198ec3002013070e7da60ff606a470dee69","user":{"login":"kindlycare","id":10181349,"avatar_url":"https://avatars.githubusercontent.com/u/10181349?v=3","gravatar_id":"","url":"https://api.github.com/users/kindlycare","html_url":"https://github.com/kindlycare","followers_url":"https://api.github.com/users/kindlycare/followers","following_url":"https://api.github.com/users/kindlycare/following{/other_user}","gists_url":"https://api.github.com/users/kindlycare/gists{/gist_id}","starred_url":"https://api.github.com/users/kindlycare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kindlycare/subscriptions","organizations_url":"https://api.github.com/users/kindlycare/orgs","repos_url":"https://api.github.com/users/kindlycare/repos","events_url":"https://api.github.com/users/kindlycare/events{/privacy}","received_events_url":"https://api.github.com/users/kindlycare/received_events","type":"Organization","site_admin":false},"repo":{"id":31086532,"name":"grunt-loopback-auto","full_name":"kindlycare/grunt-loopback-auto","owner":{"login":"kindlycare","id":10181349,"avatar_url":"https://avatars.githubusercontent.com/u/10181349?v=3","gravatar_id":"","url":"https://api.github.com/users/kindlycare","html_url":"https://github.com/kindlycare","followers_url":"https://api.github.com/users/kindlycare/followers","following_url":"https://api.github.com/users/kindlycare/following{/other_user}","gists_url":"https://api.github.com/users/kindlycare/gists{/gist_id}","starred_url":"https://api.github.com/users/kindlycare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kindlycare/subscriptions","organizations_url":"https://api.github.com/users/kindlycare/orgs","repos_url":"https://api.github.com/users/kindlycare/repos","events_url":"https://api.github.com/users/kindlycare/events{/privacy}","received_events_url":"https://api.github.com/users/kindlycare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kindlycare/grunt-loopback-auto","description":"Grunt plugin for automigrate and autoupdate data sources for LoopBack","fork":true,"url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto","forks_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/forks","keys_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/teams","hooks_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/hooks","issue_events_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/issues/events{/number}","events_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/events","assignees_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/assignees{/user}","branches_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/branches{/branch}","tags_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/tags","blobs_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/git/refs{/sha}","trees_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/statuses/{sha}","languages_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/languages","stargazers_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/stargazers","contributors_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/contributors","subscribers_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/subscribers","subscription_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/subscription","commits_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/commits{/sha}","git_commits_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/git/commits{/sha}","comments_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/comments{/number}","issue_comment_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/issues/comments{/number}","contents_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/contents/{+path}","compare_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/merges","archive_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/downloads","issues_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/issues{/number}","pulls_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/pulls{/number}","milestones_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/milestones{/number}","notifications_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/labels{/name}","releases_url":"https://api.github.com/repos/kindlycare/grunt-loopback-auto/releases{/id}","created_at":"2015-02-20T21:41:04Z","updated_at":"2015-02-20T21:41:04Z","pushed_at":"2015-02-26T09:03:40Z","git_url":"git://github.com/kindlycare/grunt-loopback-auto.git","ssh_url":"git@github.com:kindlycare/grunt-loopback-auto.git","clone_url":"https://github.com/kindlycare/grunt-loopback-auto.git","svn_url":"https://github.com/kindlycare/grunt-loopback-auto","homepage":null,"size":86,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"paulomcnally:master","ref":"master","sha":"a1090a700cbc1e98e7078a17fa93f2e38bd11a2b","user":{"login":"paulomcnally","id":181533,"avatar_url":"https://avatars.githubusercontent.com/u/181533?v=3","gravatar_id":"","url":"https://api.github.com/users/paulomcnally","html_url":"https://github.com/paulomcnally","followers_url":"https://api.github.com/users/paulomcnally/followers","following_url":"https://api.github.com/users/paulomcnally/following{/other_user}","gists_url":"https://api.github.com/users/paulomcnally/gists{/gist_id}","starred_url":"https://api.github.com/users/paulomcnally/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulomcnally/subscriptions","organizations_url":"https://api.github.com/users/paulomcnally/orgs","repos_url":"https://api.github.com/users/paulomcnally/repos","events_url":"https://api.github.com/users/paulomcnally/events{/privacy}","received_events_url":"https://api.github.com/users/paulomcnally/received_events","type":"User","site_admin":false},"repo":{"id":23338074,"name":"grunt-loopback-auto","full_name":"paulomcnally/grunt-loopback-auto","owner":{"login":"paulomcnally","id":181533,"avatar_url":"https://avatars.githubusercontent.com/u/181533?v=3","gravatar_id":"","url":"https://api.github.com/users/paulomcnally","html_url":"https://github.com/paulomcnally","followers_url":"https://api.github.com/users/paulomcnally/followers","following_url":"https://api.github.com/users/paulomcnally/following{/other_user}","gists_url":"https://api.github.com/users/paulomcnally/gists{/gist_id}","starred_url":"https://api.github.com/users/paulomcnally/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulomcnally/subscriptions","organizations_url":"https://api.github.com/users/paulomcnally/orgs","repos_url":"https://api.github.com/users/paulomcnally/repos","events_url":"https://api.github.com/users/paulomcnally/events{/privacy}","received_events_url":"https://api.github.com/users/paulomcnally/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulomcnally/grunt-loopback-auto","description":"Grunt plugin for automigrate and autoupdate data sources for LoopBack","fork":false,"url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto","forks_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/forks","keys_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/teams","hooks_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/hooks","issue_events_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/issues/events{/number}","events_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/events","assignees_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/assignees{/user}","branches_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/branches{/branch}","tags_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/tags","blobs_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/statuses/{sha}","languages_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/languages","stargazers_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/stargazers","contributors_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/contributors","subscribers_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/subscribers","subscription_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/subscription","commits_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/contents/{+path}","compare_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/merges","archive_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/downloads","issues_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/issues{/number}","pulls_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls{/number}","milestones_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/milestones{/number}","notifications_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/labels{/name}","releases_url":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/releases{/id}","created_at":"2014-08-26T03:54:08Z","updated_at":"2014-09-24T16:34:34Z","pushed_at":"2014-10-28T05:15:52Z","git_url":"git://github.com/paulomcnally/grunt-loopback-auto.git","ssh_url":"git@github.com:paulomcnally/grunt-loopback-auto.git","clone_url":"https://github.com/paulomcnally/grunt-loopback-auto.git","svn_url":"https://github.com/paulomcnally/grunt-loopback-auto","homepage":null,"size":216,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2"},"html":{"href":"https://github.com/paulomcnally/grunt-loopback-auto/pull/2"},"issue":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/issues/2"},"comments":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/paulomcnally/grunt-loopback-auto/statuses/45815198ec3002013070e7da60ff606a470dee69"}}}}