{"action":"created","comment":{"url":"https://api.github.com/repos/iknow/cerego_view_models/pulls/comments/83173214","pull_request_review_id":4031237,"id":83173214,"diff_hunk":"@@ -1,15 +1,29 @@\n class ViewModel\n   class DeserializeContext\n-    attr_accessor :updated_associations, :parent_ref\n+    attr_accessor :updated_associations, :parent_context, :parent_viewmodel\n \n-    def initialize(parent_ref: nil)\n-      self.parent_ref = parent_ref\n+    def initialize(*)\n     end\n \n-    def for_child(parent)\n+    def parent(idx = 0)\n+      if idx == 0\n+        parent_viewmodel\n+      else\n+        parent_context&.parent(idx - 1)\n+      end\n+    end\n+\n+    def parent_ref(idx = 0)\n+      parent(idx)&.to_reference\n+    end\n+\n+    def for_child(parent_viewmodel)\n       self.dup.tap do |copy|\n-        copy.parent_ref = parent.to_reference\n+        copy.parent_context   = self\n+        copy.parent_viewmodel = parent_viewmodel\n       end\n     end\n+\n+    private :parent_context, :parent_viewmodel","path":"lib/view_model/deserialize_context.rb","position":32,"original_position":32,"commit_id":"148512377cfceaa0a56b6d4a7ce58131ef505e47","original_commit_id":"825d5fde4aacd10687d5e6c6c4eeea65195eb03c","user":{"login":"thefloweringash","id":42933,"avatar_url":"https://avatars.githubusercontent.com/u/42933?v=3","gravatar_id":"","url":"https://api.github.com/users/thefloweringash","html_url":"https://github.com/thefloweringash","followers_url":"https://api.github.com/users/thefloweringash/followers","following_url":"https://api.github.com/users/thefloweringash/following{/other_user}","gists_url":"https://api.github.com/users/thefloweringash/gists{/gist_id}","starred_url":"https://api.github.com/users/thefloweringash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefloweringash/subscriptions","organizations_url":"https://api.github.com/users/thefloweringash/orgs","repos_url":"https://api.github.com/users/thefloweringash/repos","events_url":"https://api.github.com/users/thefloweringash/events{/privacy}","received_events_url":"https://api.github.com/users/thefloweringash/received_events","type":"User","site_admin":false},"body":"Awkward to leave the writers public. Is it worth making a method with a different name `initialize_descendant` to make it more obvious?","created_at":"2016-10-13T09:12:30Z","updated_at":"2016-10-13T09:12:30Z","html_url":"https://github.com/iknow/cerego_view_models/pull/23#discussion_r83173214","pull_request_url":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/iknow/cerego_view_models/pulls/comments/83173214"},"html":{"href":"https://github.com/iknow/cerego_view_models/pull/23#discussion_r83173214"},"pull_request":{"href":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23","id":89159842,"html_url":"https://github.com/iknow/cerego_view_models/pull/23","diff_url":"https://github.com/iknow/cerego_view_models/pull/23.diff","patch_url":"https://github.com/iknow/cerego_view_models/pull/23.patch","issue_url":"https://api.github.com/repos/iknow/cerego_view_models/issues/23","number":23,"state":"open","locked":false,"title":"Parsing and ancestors","user":{"login":"chrisandreae","id":186537,"avatar_url":"https://avatars.githubusercontent.com/u/186537?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisandreae","html_url":"https://github.com/chrisandreae","followers_url":"https://api.github.com/users/chrisandreae/followers","following_url":"https://api.github.com/users/chrisandreae/following{/other_user}","gists_url":"https://api.github.com/users/chrisandreae/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisandreae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisandreae/subscriptions","organizations_url":"https://api.github.com/users/chrisandreae/orgs","repos_url":"https://api.github.com/users/chrisandreae/repos","events_url":"https://api.github.com/users/chrisandreae/events{/privacy}","received_events_url":"https://api.github.com/users/chrisandreae/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-13T08:51:01Z","updated_at":"2016-10-13T09:12:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f8e3331179c3811a2f1e4baf1154bbcb3731983","assignee":{"login":"thefloweringash","id":42933,"avatar_url":"https://avatars.githubusercontent.com/u/42933?v=3","gravatar_id":"","url":"https://api.github.com/users/thefloweringash","html_url":"https://github.com/thefloweringash","followers_url":"https://api.github.com/users/thefloweringash/followers","following_url":"https://api.github.com/users/thefloweringash/following{/other_user}","gists_url":"https://api.github.com/users/thefloweringash/gists{/gist_id}","starred_url":"https://api.github.com/users/thefloweringash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefloweringash/subscriptions","organizations_url":"https://api.github.com/users/thefloweringash/orgs","repos_url":"https://api.github.com/users/thefloweringash/repos","events_url":"https://api.github.com/users/thefloweringash/events{/privacy}","received_events_url":"https://api.github.com/users/thefloweringash/received_events","type":"User","site_admin":false},"assignees":[{"login":"thefloweringash","id":42933,"avatar_url":"https://avatars.githubusercontent.com/u/42933?v=3","gravatar_id":"","url":"https://api.github.com/users/thefloweringash","html_url":"https://github.com/thefloweringash","followers_url":"https://api.github.com/users/thefloweringash/followers","following_url":"https://api.github.com/users/thefloweringash/following{/other_user}","gists_url":"https://api.github.com/users/thefloweringash/gists{/gist_id}","starred_url":"https://api.github.com/users/thefloweringash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefloweringash/subscriptions","organizations_url":"https://api.github.com/users/thefloweringash/orgs","repos_url":"https://api.github.com/users/thefloweringash/repos","events_url":"https://api.github.com/users/thefloweringash/events{/privacy}","received_events_url":"https://api.github.com/users/thefloweringash/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23/commits","review_comments_url":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23/comments","review_comment_url":"https://api.github.com/repos/iknow/cerego_view_models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iknow/cerego_view_models/issues/23/comments","statuses_url":"https://api.github.com/repos/iknow/cerego_view_models/statuses/148512377cfceaa0a56b6d4a7ce58131ef505e47","head":{"label":"iknow:parsing-and-ancestors","ref":"parsing-and-ancestors","sha":"148512377cfceaa0a56b6d4a7ce58131ef505e47","user":{"login":"iknow","id":64543,"avatar_url":"https://avatars.githubusercontent.com/u/64543?v=3","gravatar_id":"","url":"https://api.github.com/users/iknow","html_url":"https://github.com/iknow","followers_url":"https://api.github.com/users/iknow/followers","following_url":"https://api.github.com/users/iknow/following{/other_user}","gists_url":"https://api.github.com/users/iknow/gists{/gist_id}","starred_url":"https://api.github.com/users/iknow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iknow/subscriptions","organizations_url":"https://api.github.com/users/iknow/orgs","repos_url":"https://api.github.com/users/iknow/repos","events_url":"https://api.github.com/users/iknow/events{/privacy}","received_events_url":"https://api.github.com/users/iknow/received_events","type":"Organization","site_admin":false},"repo":{"id":21151085,"name":"cerego_view_models","full_name":"iknow/cerego_view_models","owner":{"login":"iknow","id":64543,"avatar_url":"https://avatars.githubusercontent.com/u/64543?v=3","gravatar_id":"","url":"https://api.github.com/users/iknow","html_url":"https://github.com/iknow","followers_url":"https://api.github.com/users/iknow/followers","following_url":"https://api.github.com/users/iknow/following{/other_user}","gists_url":"https://api.github.com/users/iknow/gists{/gist_id}","starred_url":"https://api.github.com/users/iknow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iknow/subscriptions","organizations_url":"https://api.github.com/users/iknow/orgs","repos_url":"https://api.github.com/users/iknow/repos","events_url":"https://api.github.com/users/iknow/events{/privacy}","received_events_url":"https://api.github.com/users/iknow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iknow/cerego_view_models","description":"View models shared amongst cerego projects","fork":false,"url":"https://api.github.com/repos/iknow/cerego_view_models","forks_url":"https://api.github.com/repos/iknow/cerego_view_models/forks","keys_url":"https://api.github.com/repos/iknow/cerego_view_models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iknow/cerego_view_models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iknow/cerego_view_models/teams","hooks_url":"https://api.github.com/repos/iknow/cerego_view_models/hooks","issue_events_url":"https://api.github.com/repos/iknow/cerego_view_models/issues/events{/number}","events_url":"https://api.github.com/repos/iknow/cerego_view_models/events","assignees_url":"https://api.github.com/repos/iknow/cerego_view_models/assignees{/user}","branches_url":"https://api.github.com/repos/iknow/cerego_view_models/branches{/branch}","tags_url":"https://api.github.com/repos/iknow/cerego_view_models/tags","blobs_url":"https://api.github.com/repos/iknow/cerego_view_models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iknow/cerego_view_models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iknow/cerego_view_models/git/refs{/sha}","trees_url":"https://api.github.com/repos/iknow/cerego_view_models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iknow/cerego_view_models/statuses/{sha}","languages_url":"https://api.github.com/repos/iknow/cerego_view_models/languages","stargazers_url":"https://api.github.com/repos/iknow/cerego_view_models/stargazers","contributors_url":"https://api.github.com/repos/iknow/cerego_view_models/contributors","subscribers_url":"https://api.github.com/repos/iknow/cerego_view_models/subscribers","subscription_url":"https://api.github.com/repos/iknow/cerego_view_models/subscription","commits_url":"https://api.github.com/repos/iknow/cerego_view_models/commits{/sha}","git_commits_url":"https://api.github.com/repos/iknow/cerego_view_models/git/commits{/sha}","comments_url":"https://api.github.com/repos/iknow/cerego_view_models/comments{/number}","issue_comment_url":"https://api.github.com/repos/iknow/cerego_view_models/issues/comments{/number}","contents_url":"https://api.github.com/repos/iknow/cerego_view_models/contents/{+path}","compare_url":"https://api.github.com/repos/iknow/cerego_view_models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iknow/cerego_view_models/merges","archive_url":"https://api.github.com/repos/iknow/cerego_view_models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iknow/cerego_view_models/downloads","issues_url":"https://api.github.com/repos/iknow/cerego_view_models/issues{/number}","pulls_url":"https://api.github.com/repos/iknow/cerego_view_models/pulls{/number}","milestones_url":"https://api.github.com/repos/iknow/cerego_view_models/milestones{/number}","notifications_url":"https://api.github.com/repos/iknow/cerego_view_models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iknow/cerego_view_models/labels{/name}","releases_url":"https://api.github.com/repos/iknow/cerego_view_models/releases{/id}","deployments_url":"https://api.github.com/repos/iknow/cerego_view_models/deployments","created_at":"2014-06-24T03:38:19Z","updated_at":"2016-07-12T06:04:00Z","pushed_at":"2016-10-13T08:51:01Z","git_url":"git://github.com/iknow/cerego_view_models.git","ssh_url":"git@github.com:iknow/cerego_view_models.git","clone_url":"https://github.com/iknow/cerego_view_models.git","svn_url":"https://github.com/iknow/cerego_view_models","homepage":null,"size":411,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"iknow:master","ref":"master","sha":"0104f181fbef42ae5b8a1e455016c4be07d1b308","user":{"login":"iknow","id":64543,"avatar_url":"https://avatars.githubusercontent.com/u/64543?v=3","gravatar_id":"","url":"https://api.github.com/users/iknow","html_url":"https://github.com/iknow","followers_url":"https://api.github.com/users/iknow/followers","following_url":"https://api.github.com/users/iknow/following{/other_user}","gists_url":"https://api.github.com/users/iknow/gists{/gist_id}","starred_url":"https://api.github.com/users/iknow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iknow/subscriptions","organizations_url":"https://api.github.com/users/iknow/orgs","repos_url":"https://api.github.com/users/iknow/repos","events_url":"https://api.github.com/users/iknow/events{/privacy}","received_events_url":"https://api.github.com/users/iknow/received_events","type":"Organization","site_admin":false},"repo":{"id":21151085,"name":"cerego_view_models","full_name":"iknow/cerego_view_models","owner":{"login":"iknow","id":64543,"avatar_url":"https://avatars.githubusercontent.com/u/64543?v=3","gravatar_id":"","url":"https://api.github.com/users/iknow","html_url":"https://github.com/iknow","followers_url":"https://api.github.com/users/iknow/followers","following_url":"https://api.github.com/users/iknow/following{/other_user}","gists_url":"https://api.github.com/users/iknow/gists{/gist_id}","starred_url":"https://api.github.com/users/iknow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iknow/subscriptions","organizations_url":"https://api.github.com/users/iknow/orgs","repos_url":"https://api.github.com/users/iknow/repos","events_url":"https://api.github.com/users/iknow/events{/privacy}","received_events_url":"https://api.github.com/users/iknow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iknow/cerego_view_models","description":"View models shared amongst cerego projects","fork":false,"url":"https://api.github.com/repos/iknow/cerego_view_models","forks_url":"https://api.github.com/repos/iknow/cerego_view_models/forks","keys_url":"https://api.github.com/repos/iknow/cerego_view_models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iknow/cerego_view_models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iknow/cerego_view_models/teams","hooks_url":"https://api.github.com/repos/iknow/cerego_view_models/hooks","issue_events_url":"https://api.github.com/repos/iknow/cerego_view_models/issues/events{/number}","events_url":"https://api.github.com/repos/iknow/cerego_view_models/events","assignees_url":"https://api.github.com/repos/iknow/cerego_view_models/assignees{/user}","branches_url":"https://api.github.com/repos/iknow/cerego_view_models/branches{/branch}","tags_url":"https://api.github.com/repos/iknow/cerego_view_models/tags","blobs_url":"https://api.github.com/repos/iknow/cerego_view_models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iknow/cerego_view_models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iknow/cerego_view_models/git/refs{/sha}","trees_url":"https://api.github.com/repos/iknow/cerego_view_models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iknow/cerego_view_models/statuses/{sha}","languages_url":"https://api.github.com/repos/iknow/cerego_view_models/languages","stargazers_url":"https://api.github.com/repos/iknow/cerego_view_models/stargazers","contributors_url":"https://api.github.com/repos/iknow/cerego_view_models/contributors","subscribers_url":"https://api.github.com/repos/iknow/cerego_view_models/subscribers","subscription_url":"https://api.github.com/repos/iknow/cerego_view_models/subscription","commits_url":"https://api.github.com/repos/iknow/cerego_view_models/commits{/sha}","git_commits_url":"https://api.github.com/repos/iknow/cerego_view_models/git/commits{/sha}","comments_url":"https://api.github.com/repos/iknow/cerego_view_models/comments{/number}","issue_comment_url":"https://api.github.com/repos/iknow/cerego_view_models/issues/comments{/number}","contents_url":"https://api.github.com/repos/iknow/cerego_view_models/contents/{+path}","compare_url":"https://api.github.com/repos/iknow/cerego_view_models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iknow/cerego_view_models/merges","archive_url":"https://api.github.com/repos/iknow/cerego_view_models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iknow/cerego_view_models/downloads","issues_url":"https://api.github.com/repos/iknow/cerego_view_models/issues{/number}","pulls_url":"https://api.github.com/repos/iknow/cerego_view_models/pulls{/number}","milestones_url":"https://api.github.com/repos/iknow/cerego_view_models/milestones{/number}","notifications_url":"https://api.github.com/repos/iknow/cerego_view_models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iknow/cerego_view_models/labels{/name}","releases_url":"https://api.github.com/repos/iknow/cerego_view_models/releases{/id}","deployments_url":"https://api.github.com/repos/iknow/cerego_view_models/deployments","created_at":"2014-06-24T03:38:19Z","updated_at":"2016-07-12T06:04:00Z","pushed_at":"2016-10-13T08:51:01Z","git_url":"git://github.com/iknow/cerego_view_models.git","ssh_url":"git@github.com:iknow/cerego_view_models.git","clone_url":"https://github.com/iknow/cerego_view_models.git","svn_url":"https://github.com/iknow/cerego_view_models","homepage":null,"size":411,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23"},"html":{"href":"https://github.com/iknow/cerego_view_models/pull/23"},"issue":{"href":"https://api.github.com/repos/iknow/cerego_view_models/issues/23"},"comments":{"href":"https://api.github.com/repos/iknow/cerego_view_models/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/iknow/cerego_view_models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iknow/cerego_view_models/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/iknow/cerego_view_models/statuses/148512377cfceaa0a56b6d4a7ce58131ef505e47"}}}}
{"actor":{"display_login":"thefloweringash"}}