{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1010","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1010/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1010/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1010/events","html_url":"https://github.com/strongloop/loopback/issues/1010","id":54359883,"number":1010,"title":"Local Model hasOne remote model uses incorrect model id","user":{"login":"BerkeleyTrue","id":6775919,"avatar_url":"https://avatars.githubusercontent.com/u/6775919?v=3","gravatar_id":"","url":"https://api.github.com/users/BerkeleyTrue","html_url":"https://github.com/BerkeleyTrue","followers_url":"https://api.github.com/users/BerkeleyTrue/followers","following_url":"https://api.github.com/users/BerkeleyTrue/following{/other_user}","gists_url":"https://api.github.com/users/BerkeleyTrue/gists{/gist_id}","starred_url":"https://api.github.com/users/BerkeleyTrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BerkeleyTrue/subscriptions","organizations_url":"https://api.github.com/users/BerkeleyTrue/orgs","repos_url":"https://api.github.com/users/BerkeleyTrue/repos","events_url":"https://api.github.com/users/BerkeleyTrue/events{/privacy}","received_events_url":"https://api.github.com/users/BerkeleyTrue/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-14T18:47:12Z","updated_at":"2015-01-31T01:04:47Z","closed_at":null,"body":"I have a model Mat with HasOne relation Origin. I have local model LocalMat in the client.\r\n\r\nCalling `localMat.origin()`  causes Unknown \"origin\" id \"undefined\".\r\n\r\nIt seams that https://github.com/strongloop/loopback-datasource-juggler/blob/master/lib/relation-definition.js#L1432 is useing the model name 'localMat' to create the foreign key 'localMatId' which is incorrect. \r\n\r\nThis does not seem to affect hasMany, belongsTo relationships."},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/72296511","html_url":"https://github.com/strongloop/loopback/issues/1010#issuecomment-72296511","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1010","id":72296511,"user":{"login":"kraman","id":449065,"avatar_url":"https://avatars.githubusercontent.com/u/449065?v=3","gravatar_id":"","url":"https://api.github.com/users/kraman","html_url":"https://github.com/kraman","followers_url":"https://api.github.com/users/kraman/followers","following_url":"https://api.github.com/users/kraman/following{/other_user}","gists_url":"https://api.github.com/users/kraman/gists{/gist_id}","starred_url":"https://api.github.com/users/kraman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kraman/subscriptions","organizations_url":"https://api.github.com/users/kraman/orgs","repos_url":"https://api.github.com/users/kraman/repos","events_url":"https://api.github.com/users/kraman/events{/privacy}","received_events_url":"https://api.github.com/users/kraman/received_events","type":"User","site_admin":false},"created_at":"2015-01-31T01:04:47Z","updated_at":"2015-01-31T01:04:47Z","body":"@ritch Haven't run into this situation yet but I probably will soon or later."}}