{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1344","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1344/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1344/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1344/events","html_url":"https://github.com/strongloop/loopback/issues/1344","id":71628531,"number":1344,"title":"3.0 remove `Model.setup()`","user":{"login":"ritch","id":462228,"avatar_url":"https://avatars.githubusercontent.com/u/462228?v=3","gravatar_id":"","url":"https://api.github.com/users/ritch","html_url":"https://github.com/ritch","followers_url":"https://api.github.com/users/ritch/followers","following_url":"https://api.github.com/users/ritch/following{/other_user}","gists_url":"https://api.github.com/users/ritch/gists{/gist_id}","starred_url":"https://api.github.com/users/ritch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritch/subscriptions","organizations_url":"https://api.github.com/users/ritch/orgs","repos_url":"https://api.github.com/users/ritch/repos","events_url":"https://api.github.com/users/ritch/events{/privacy}","received_events_url":"https://api.github.com/users/ritch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-28T15:54:31Z","updated_at":"2015-04-28T16:04:14Z","closed_at":null,"body":"I'd like to propose removing `Model.setup()` in favor of the following:\r\n\r\n```js\r\n// common/models/my-model.js\r\nmodule.exports = function(Model) {\r\n  // this is now the setup function\r\n  // it is called once when MyModel is initial created and each time it is extended\r\n  // passing the extended Model as the argument\r\n}\r\n```\r\n\r\n```js\r\n// if you want the same behavior as 2.x Model.setup() in JS land\r\nMyModel.extend = function() {\r\n  var ExtendedModel = this._extend(); // new alias\r\n  mySetupFn.apply(ExtendedModel);\r\n  return ExtendedModel;\r\n}\r\n```\r\n/cc @bajtos @raymondfeng @fabien"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/97120120","html_url":"https://github.com/strongloop/loopback/issues/1344#issuecomment-97120120","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1344","id":97120120,"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},"created_at":"2015-04-28T16:04:14Z","updated_at":"2015-04-28T16:04:14Z","body":"I don't think this is possible in the current design, where loobpack core does not dictate any project layout, thus there is no \"common/models/my-model.js\" as far as loopback & juggler are concerned."}}