{"action":"opened","number":62,"pull_request":{"url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/62","id":75202219,"html_url":"https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin/pull/62","diff_url":"https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin/pull/62.diff","patch_url":"https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin/pull/62.patch","issue_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/issues/62","number":62,"state":"open","locked":false,"title":"BelongsTo association details in audit delta","user":{"login":"fr0z3nfyr","id":5248866,"avatar_url":"https://avatars.githubusercontent.com/u/5248866?v=3","gravatar_id":"","url":"https://api.github.com/users/fr0z3nfyr","html_url":"https://github.com/fr0z3nfyr","followers_url":"https://api.github.com/users/fr0z3nfyr/followers","following_url":"https://api.github.com/users/fr0z3nfyr/following{/other_user}","gists_url":"https://api.github.com/users/fr0z3nfyr/gists{/gist_id}","starred_url":"https://api.github.com/users/fr0z3nfyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fr0z3nfyr/subscriptions","organizations_url":"https://api.github.com/users/fr0z3nfyr/orgs","repos_url":"https://api.github.com/users/fr0z3nfyr/repos","events_url":"https://api.github.com/users/fr0z3nfyr/events{/privacy}","received_events_url":"https://api.github.com/users/fr0z3nfyr/received_events","type":"User","site_admin":false},"body":"**Changes:**\r\nAn additional function `_btModel($str, $array)` which will return either the associated model class name or the original field name(if a regular field of $Model). Using that function in afterSave to set values in `$delta`.\r\n\r\n**Result:**\r\nModel class name of belongsTo model instead of associated fieldname (example: **\"User\" instead of user_id**) and display field value instead of foreign_key (example: **\"John Doe\" instead of 1**) in `property_name` and `old_value`/ `new_value` are saved in audit_deltas respectively. \r\n\r\n**Benefit:**\r\nThis will make displaying the activity log of a record less painful for the developer and still meaningful for end user without any extra effort.","created_at":"2016-06-25T10:59:16Z","updated_at":"2016-06-25T10:59:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/62/commits","review_comments_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/62/comments","review_comment_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/issues/62/comments","statuses_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/statuses/770b72a0e9547ed9b52294126c4d03cfe71c3d67","head":{"label":"fr0z3nfyr:delta-btm-detail","ref":"delta-btm-detail","sha":"770b72a0e9547ed9b52294126c4d03cfe71c3d67","user":{"login":"fr0z3nfyr","id":5248866,"avatar_url":"https://avatars.githubusercontent.com/u/5248866?v=3","gravatar_id":"","url":"https://api.github.com/users/fr0z3nfyr","html_url":"https://github.com/fr0z3nfyr","followers_url":"https://api.github.com/users/fr0z3nfyr/followers","following_url":"https://api.github.com/users/fr0z3nfyr/following{/other_user}","gists_url":"https://api.github.com/users/fr0z3nfyr/gists{/gist_id}","starred_url":"https://api.github.com/users/fr0z3nfyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fr0z3nfyr/subscriptions","organizations_url":"https://api.github.com/users/fr0z3nfyr/orgs","repos_url":"https://api.github.com/users/fr0z3nfyr/repos","events_url":"https://api.github.com/users/fr0z3nfyr/events{/privacy}","received_events_url":"https://api.github.com/users/fr0z3nfyr/received_events","type":"User","site_admin":false},"repo":{"id":61934668,"name":"CakePHP-Audit-Log-Plugin","full_name":"fr0z3nfyr/CakePHP-Audit-Log-Plugin","owner":{"login":"fr0z3nfyr","id":5248866,"avatar_url":"https://avatars.githubusercontent.com/u/5248866?v=3","gravatar_id":"","url":"https://api.github.com/users/fr0z3nfyr","html_url":"https://github.com/fr0z3nfyr","followers_url":"https://api.github.com/users/fr0z3nfyr/followers","following_url":"https://api.github.com/users/fr0z3nfyr/following{/other_user}","gists_url":"https://api.github.com/users/fr0z3nfyr/gists{/gist_id}","starred_url":"https://api.github.com/users/fr0z3nfyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fr0z3nfyr/subscriptions","organizations_url":"https://api.github.com/users/fr0z3nfyr/orgs","repos_url":"https://api.github.com/users/fr0z3nfyr/repos","events_url":"https://api.github.com/users/fr0z3nfyr/events{/privacy}","received_events_url":"https://api.github.com/users/fr0z3nfyr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fr0z3nfyr/CakePHP-Audit-Log-Plugin","description":"Records changes made to an object during CRUD operations.","fork":true,"url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin","forks_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/forks","keys_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/teams","hooks_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/hooks","issue_events_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/issues/events{/number}","events_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/events","assignees_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/assignees{/user}","branches_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/branches{/branch}","tags_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/tags","blobs_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/languages","stargazers_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/stargazers","contributors_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/contributors","subscribers_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/subscribers","subscription_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/subscription","commits_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/contents/{+path}","compare_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/merges","archive_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/downloads","issues_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/issues{/number}","pulls_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/labels{/name}","releases_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/releases{/id}","deployments_url":"https://api.github.com/repos/fr0z3nfyr/CakePHP-Audit-Log-Plugin/deployments","created_at":"2016-06-25T08:43:49Z","updated_at":"2016-06-25T08:43:51Z","pushed_at":"2016-06-25T10:41:17Z","git_url":"git://github.com/fr0z3nfyr/CakePHP-Audit-Log-Plugin.git","ssh_url":"git@github.com:fr0z3nfyr/CakePHP-Audit-Log-Plugin.git","clone_url":"https://github.com/fr0z3nfyr/CakePHP-Audit-Log-Plugin.git","svn_url":"https://github.com/fr0z3nfyr/CakePHP-Audit-Log-Plugin","homepage":"","size":141,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"robwilkerson:master","ref":"master","sha":"c69e83c2929d2f4896f34e9d12743f0e701de07f","user":{"login":"robwilkerson","id":7735,"avatar_url":"https://avatars.githubusercontent.com/u/7735?v=3","gravatar_id":"","url":"https://api.github.com/users/robwilkerson","html_url":"https://github.com/robwilkerson","followers_url":"https://api.github.com/users/robwilkerson/followers","following_url":"https://api.github.com/users/robwilkerson/following{/other_user}","gists_url":"https://api.github.com/users/robwilkerson/gists{/gist_id}","starred_url":"https://api.github.com/users/robwilkerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwilkerson/subscriptions","organizations_url":"https://api.github.com/users/robwilkerson/orgs","repos_url":"https://api.github.com/users/robwilkerson/repos","events_url":"https://api.github.com/users/robwilkerson/events{/privacy}","received_events_url":"https://api.github.com/users/robwilkerson/received_events","type":"User","site_admin":false},"repo":{"id":797252,"name":"CakePHP-Audit-Log-Plugin","full_name":"robwilkerson/CakePHP-Audit-Log-Plugin","owner":{"login":"robwilkerson","id":7735,"avatar_url":"https://avatars.githubusercontent.com/u/7735?v=3","gravatar_id":"","url":"https://api.github.com/users/robwilkerson","html_url":"https://github.com/robwilkerson","followers_url":"https://api.github.com/users/robwilkerson/followers","following_url":"https://api.github.com/users/robwilkerson/following{/other_user}","gists_url":"https://api.github.com/users/robwilkerson/gists{/gist_id}","starred_url":"https://api.github.com/users/robwilkerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwilkerson/subscriptions","organizations_url":"https://api.github.com/users/robwilkerson/orgs","repos_url":"https://api.github.com/users/robwilkerson/repos","events_url":"https://api.github.com/users/robwilkerson/events{/privacy}","received_events_url":"https://api.github.com/users/robwilkerson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin","description":"Records changes made to an object during CRUD operations.","fork":false,"url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin","forks_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/forks","keys_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/teams","hooks_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/hooks","issue_events_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/issues/events{/number}","events_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/events","assignees_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/assignees{/user}","branches_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/branches{/branch}","tags_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/tags","blobs_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/languages","stargazers_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/stargazers","contributors_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/contributors","subscribers_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/subscribers","subscription_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/subscription","commits_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/contents/{+path}","compare_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/merges","archive_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/downloads","issues_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/issues{/number}","pulls_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/labels{/name}","releases_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/releases{/id}","deployments_url":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/deployments","created_at":"2010-07-25T22:53:42Z","updated_at":"2016-06-24T09:56:47Z","pushed_at":"2016-06-25T10:59:16Z","git_url":"git://github.com/robwilkerson/CakePHP-Audit-Log-Plugin.git","ssh_url":"git@github.com:robwilkerson/CakePHP-Audit-Log-Plugin.git","clone_url":"https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin.git","svn_url":"https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin","homepage":"","size":141,"stargazers_count":101,"watchers_count":101,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":11,"forks":65,"open_issues":11,"watchers":101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/62"},"html":{"href":"https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin/pull/62"},"issue":{"href":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/issues/62"},"comments":{"href":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/robwilkerson/CakePHP-Audit-Log-Plugin/statuses/770b72a0e9547ed9b52294126c4d03cfe71c3d67"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":29,"deletions":4,"changed_files":1}}
{"actor":{"display_login":"fr0z3nfyr"}}