{"action":"created","issue":{"url":"https://api.github.com/repos/genkgo/ember-localforage-adapter/issues/48","labels_url":"https://api.github.com/repos/genkgo/ember-localforage-adapter/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/genkgo/ember-localforage-adapter/issues/48/comments","events_url":"https://api.github.com/repos/genkgo/ember-localforage-adapter/issues/48/events","html_url":"https://github.com/genkgo/ember-localforage-adapter/pull/48","id":109461459,"number":48,"title":"Fixes and upgrades for 113","user":{"login":"sebweaver","id":1648321,"avatar_url":"https://avatars.githubusercontent.com/u/1648321?v=3","gravatar_id":"","url":"https://api.github.com/users/sebweaver","html_url":"https://github.com/sebweaver","followers_url":"https://api.github.com/users/sebweaver/followers","following_url":"https://api.github.com/users/sebweaver/following{/other_user}","gists_url":"https://api.github.com/users/sebweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/sebweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebweaver/subscriptions","organizations_url":"https://api.github.com/users/sebweaver/orgs","repos_url":"https://api.github.com/users/sebweaver/repos","events_url":"https://api.github.com/users/sebweaver/events{/privacy}","received_events_url":"https://api.github.com/users/sebweaver/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-02T09:42:32Z","updated_at":"2015-10-06T12:49:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/genkgo/ember-localforage-adapter/pulls/48","html_url":"https://github.com/genkgo/ember-localforage-adapter/pull/48","diff_url":"https://github.com/genkgo/ember-localforage-adapter/pull/48.diff","patch_url":"https://github.com/genkgo/ember-localforage-adapter/pull/48.patch"},"body":"This PR includes:\r\n\r\n- Clean tests from ELA 2.0\r\n- Workarounds introduced in ELA 2.0 (only one of them is really required, but both are better)\r\n- A fix for `findAll()` which didn't load relationships whereas `findMany()` does (let me know whether it was on purpose or not)\r\n- Thanks to https://github.com/genkgo/ember-localforage-adapter/commit/e07abfbb5d2813c48f837390c95cf92cd9a0284b (see issue #46), fix the loading of missing relationships (related to issue #45)\r\n- Leveling some code patterns\r\n- New tests for all of it\r\n\r\nAbout issue #45, here are the 2 groups of 2 cases this PR covers:\r\n\r\n1. `hasMany` relationships:\r\n  1. when some of the related records are missing in the localForage\r\n  1. when some of the related records are external to localForage and unreachable\r\n1. `belongsTo` relationships:\r\n  1. when the related record is missing in the localForage\r\n  1. when the related record is external to localForage and unreachable\r\n\r\nFor the first group of cases, the main record is resolved with its known and reachable related records, others are ignored.\r\n\r\nFor the second group of cases, the main record is resolved but without the missing or unreachable related records.\r\n\r\nAll of these cases warns the user in the console.\r\n\r\n*Note # 1: In order to mock-up external relationships in the tests, and for the sake of simplicity, I just added a new set of models and fixtures which are loaded in localForage under a dedicated namespace. The corresponding new records, involved in relationships from the main localForage, are loaded by their own adapters (since the fix of #46) and consequently act as they were loaded from elsewhere/anywhere.*\r\n\r\n*Note # 2: Some fixes and improvements of this PR can be easily pick to the master branch, except those concerning the loading of the relationships which is now obsolete. I will create another PR for that.*\r\n\r\nThank you for reviewing! :smiley: "},"comment":{"url":"https://api.github.com/repos/genkgo/ember-localforage-adapter/issues/comments/145846972","html_url":"https://github.com/genkgo/ember-localforage-adapter/pull/48#issuecomment-145846972","issue_url":"https://api.github.com/repos/genkgo/ember-localforage-adapter/issues/48","id":145846972,"user":{"login":"sebweaver","id":1648321,"avatar_url":"https://avatars.githubusercontent.com/u/1648321?v=3","gravatar_id":"","url":"https://api.github.com/users/sebweaver","html_url":"https://github.com/sebweaver","followers_url":"https://api.github.com/users/sebweaver/followers","following_url":"https://api.github.com/users/sebweaver/following{/other_user}","gists_url":"https://api.github.com/users/sebweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/sebweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebweaver/subscriptions","organizations_url":"https://api.github.com/users/sebweaver/orgs","repos_url":"https://api.github.com/users/sebweaver/repos","events_url":"https://api.github.com/users/sebweaver/events{/privacy}","received_events_url":"https://api.github.com/users/sebweaver/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T12:49:29Z","updated_at":"2015-10-06T12:49:29Z","body":"Ok to have access to the repo. I like this project. Thank you for you trust.\r\n\r\n\"With great power comes great responsibility\" :smile: "}}