{"action":"created","comment":{"url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/comments/61593105","id":61593105,"diff_hunk":"@@ -0,0 +1,219 @@\n+/**\n+* File Name :   CW_AudienceGroupTriggerHandler.cls\n+* Description : D-106803\n+*\n+* Modification Log\n+* ============================================================================\n+* Ver Date\t   Author\t\t Modification\n+* --- ---------- -------------- --------------------------\n+* 0.1 24/04/2014 AleX Panka      Initial version\n+* 0.2 25/04/2014 Klea Kolaric    B-111670\n+* 0.3 03/06/2014 Klea Kolaric    B-114503\n+*\n+*\n+*/\n+//Cristina P: 25/06/14: Changing the class from \"with sharing\" to \"without sharing\" \n+//so the user can create related records while cost/brief is in approval\n+public without sharing class CW_AudienceGroupTriggerHandler {\n+\t\n+\tpublic static final String SEPARATOR = '_';\n+\t\n+\tpublic static void OnBeforeUpdateValidation(List<CW_Audience_Group__c> oldRecs, Map<Id,CW_Audience_Group__c> newRecs){\n+\t\tList<Id> IdsToCheck= new List<Id>();\n+\t\t//As trhere is less control groups we fiter for them\n+\t\tfor(CW_Audience_Group__c Oldrec :oldRecs ){\n+\t\t\tif(OldRec.Is_Control_Group__c){\n+\t\t\t\tCW_Audience_Group__c NewRec=newRecs.get(OldRec.ID);\n+\t\t\t\tif (!NewRec.Is_Control_Group__c){\n+\t\t\t\t\t//We have winner ;-)\n+\t\t\t\t\tIdsToCheck.Add(OldRec.ID);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t\tif( IdsToCheck.Size()>0){\n+\t\t\tsystem.debug('#############There a records to chceck');\n+\t\t\tfor(CW_Audience_Group__c Rec: [SELECT ID, \n+\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(Select Id  From Control_Groups__r Limit 1) \n+\t\t\t\t\t\t  \t\t\t\t\t\t\t\tFROM CW_Audience_Group__c  \n+\t\t\t\t\t\t  \t\t\t\t\t\t\t\tWHERE ID =: IdsToCheck]){\n+\t\t\t\tif(Rec.Control_Groups__r==null)\t\n+\t\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}else system.debug('#############There a no records chceck');\n+\t}\n+\t\n+\t// update AGS if major changes on AG\n+\tpublic static void updateAGS(Map<Id,CW_Audience_Group__c> newTriggerMap, Map<Id,CW_Audience_Group__c> oldTriggerMap)","path":"src/classes/CW_AudienceGroupTriggerHandler.cls","position":46,"original_position":46,"commit_id":"714c08cfff4b74a7e823ac4b37b4156817224b7e","original_commit_id":"714c08cfff4b74a7e823ac4b37b4156817224b7e","user":{"login":"eroispaziali","id":1273282,"avatar_url":"https://avatars.githubusercontent.com/u/1273282?v=3","gravatar_id":"","url":"https://api.github.com/users/eroispaziali","html_url":"https://github.com/eroispaziali","followers_url":"https://api.github.com/users/eroispaziali/followers","following_url":"https://api.github.com/users/eroispaziali/following{/other_user}","gists_url":"https://api.github.com/users/eroispaziali/gists{/gist_id}","starred_url":"https://api.github.com/users/eroispaziali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroispaziali/subscriptions","organizations_url":"https://api.github.com/users/eroispaziali/orgs","repos_url":"https://api.github.com/users/eroispaziali/repos","events_url":"https://api.github.com/users/eroispaziali/events{/privacy}","received_events_url":"https://api.github.com/users/eroispaziali/received_events","type":"User","site_admin":false},"body":"Style issue: methods should use the \"lowerCamelCase\" notation. Suggestion: rename accordingly.","created_at":"2016-04-29T15:11:50Z","updated_at":"2016-04-29T15:11:50Z","html_url":"https://github.com/eroispaziali/silly-repo/pull/5#discussion_r61593105","pull_request_url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/comments/61593105"},"html":{"href":"https://github.com/eroispaziali/silly-repo/pull/5#discussion_r61593105"},"pull_request":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/5","id":68382988,"html_url":"https://github.com/eroispaziali/silly-repo/pull/5","diff_url":"https://github.com/eroispaziali/silly-repo/pull/5.diff","patch_url":"https://github.com/eroispaziali/silly-repo/pull/5.patch","issue_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues/5","number":5,"state":"open","locked":false,"title":"New","user":{"login":"eroispaziali","id":1273282,"avatar_url":"https://avatars.githubusercontent.com/u/1273282?v=3","gravatar_id":"","url":"https://api.github.com/users/eroispaziali","html_url":"https://github.com/eroispaziali","followers_url":"https://api.github.com/users/eroispaziali/followers","following_url":"https://api.github.com/users/eroispaziali/following{/other_user}","gists_url":"https://api.github.com/users/eroispaziali/gists{/gist_id}","starred_url":"https://api.github.com/users/eroispaziali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroispaziali/subscriptions","organizations_url":"https://api.github.com/users/eroispaziali/orgs","repos_url":"https://api.github.com/users/eroispaziali/repos","events_url":"https://api.github.com/users/eroispaziali/events{/privacy}","received_events_url":"https://api.github.com/users/eroispaziali/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-29T14:46:07Z","updated_at":"2016-04-29T15:11:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17cdd3642a11ea119ee8cac71b5ac47cc1a4de72","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/5/commits","review_comments_url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/5/comments","review_comment_url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues/5/comments","statuses_url":"https://api.github.com/repos/eroispaziali/silly-repo/statuses/714c08cfff4b74a7e823ac4b37b4156817224b7e","head":{"label":"eroispaziali:new","ref":"new","sha":"714c08cfff4b74a7e823ac4b37b4156817224b7e","user":{"login":"eroispaziali","id":1273282,"avatar_url":"https://avatars.githubusercontent.com/u/1273282?v=3","gravatar_id":"","url":"https://api.github.com/users/eroispaziali","html_url":"https://github.com/eroispaziali","followers_url":"https://api.github.com/users/eroispaziali/followers","following_url":"https://api.github.com/users/eroispaziali/following{/other_user}","gists_url":"https://api.github.com/users/eroispaziali/gists{/gist_id}","starred_url":"https://api.github.com/users/eroispaziali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroispaziali/subscriptions","organizations_url":"https://api.github.com/users/eroispaziali/orgs","repos_url":"https://api.github.com/users/eroispaziali/repos","events_url":"https://api.github.com/users/eroispaziali/events{/privacy}","received_events_url":"https://api.github.com/users/eroispaziali/received_events","type":"User","site_admin":false},"repo":{"id":56512547,"name":"silly-repo","full_name":"eroispaziali/silly-repo","owner":{"login":"eroispaziali","id":1273282,"avatar_url":"https://avatars.githubusercontent.com/u/1273282?v=3","gravatar_id":"","url":"https://api.github.com/users/eroispaziali","html_url":"https://github.com/eroispaziali","followers_url":"https://api.github.com/users/eroispaziali/followers","following_url":"https://api.github.com/users/eroispaziali/following{/other_user}","gists_url":"https://api.github.com/users/eroispaziali/gists{/gist_id}","starred_url":"https://api.github.com/users/eroispaziali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroispaziali/subscriptions","organizations_url":"https://api.github.com/users/eroispaziali/orgs","repos_url":"https://api.github.com/users/eroispaziali/repos","events_url":"https://api.github.com/users/eroispaziali/events{/privacy}","received_events_url":"https://api.github.com/users/eroispaziali/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eroispaziali/silly-repo","description":"This repo is just for testing GitHub APIs","fork":false,"url":"https://api.github.com/repos/eroispaziali/silly-repo","forks_url":"https://api.github.com/repos/eroispaziali/silly-repo/forks","keys_url":"https://api.github.com/repos/eroispaziali/silly-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eroispaziali/silly-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eroispaziali/silly-repo/teams","hooks_url":"https://api.github.com/repos/eroispaziali/silly-repo/hooks","issue_events_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues/events{/number}","events_url":"https://api.github.com/repos/eroispaziali/silly-repo/events","assignees_url":"https://api.github.com/repos/eroispaziali/silly-repo/assignees{/user}","branches_url":"https://api.github.com/repos/eroispaziali/silly-repo/branches{/branch}","tags_url":"https://api.github.com/repos/eroispaziali/silly-repo/tags","blobs_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eroispaziali/silly-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/eroispaziali/silly-repo/languages","stargazers_url":"https://api.github.com/repos/eroispaziali/silly-repo/stargazers","contributors_url":"https://api.github.com/repos/eroispaziali/silly-repo/contributors","subscribers_url":"https://api.github.com/repos/eroispaziali/silly-repo/subscribers","subscription_url":"https://api.github.com/repos/eroispaziali/silly-repo/subscription","commits_url":"https://api.github.com/repos/eroispaziali/silly-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/eroispaziali/silly-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/eroispaziali/silly-repo/contents/{+path}","compare_url":"https://api.github.com/repos/eroispaziali/silly-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eroispaziali/silly-repo/merges","archive_url":"https://api.github.com/repos/eroispaziali/silly-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eroispaziali/silly-repo/downloads","issues_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues{/number}","pulls_url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/eroispaziali/silly-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/eroispaziali/silly-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eroispaziali/silly-repo/labels{/name}","releases_url":"https://api.github.com/repos/eroispaziali/silly-repo/releases{/id}","deployments_url":"https://api.github.com/repos/eroispaziali/silly-repo/deployments","created_at":"2016-04-18T14:02:28Z","updated_at":"2016-04-20T18:49:34Z","pushed_at":"2016-04-29T14:46:07Z","git_url":"git://github.com/eroispaziali/silly-repo.git","ssh_url":"git@github.com:eroispaziali/silly-repo.git","clone_url":"https://github.com/eroispaziali/silly-repo.git","svn_url":"https://github.com/eroispaziali/silly-repo","homepage":null,"size":2487,"stargazers_count":0,"watchers_count":0,"language":"Apex","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":"eroispaziali:master","ref":"master","sha":"cf6e618ba8008d2569e401a88e2f3a65be37be18","user":{"login":"eroispaziali","id":1273282,"avatar_url":"https://avatars.githubusercontent.com/u/1273282?v=3","gravatar_id":"","url":"https://api.github.com/users/eroispaziali","html_url":"https://github.com/eroispaziali","followers_url":"https://api.github.com/users/eroispaziali/followers","following_url":"https://api.github.com/users/eroispaziali/following{/other_user}","gists_url":"https://api.github.com/users/eroispaziali/gists{/gist_id}","starred_url":"https://api.github.com/users/eroispaziali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroispaziali/subscriptions","organizations_url":"https://api.github.com/users/eroispaziali/orgs","repos_url":"https://api.github.com/users/eroispaziali/repos","events_url":"https://api.github.com/users/eroispaziali/events{/privacy}","received_events_url":"https://api.github.com/users/eroispaziali/received_events","type":"User","site_admin":false},"repo":{"id":56512547,"name":"silly-repo","full_name":"eroispaziali/silly-repo","owner":{"login":"eroispaziali","id":1273282,"avatar_url":"https://avatars.githubusercontent.com/u/1273282?v=3","gravatar_id":"","url":"https://api.github.com/users/eroispaziali","html_url":"https://github.com/eroispaziali","followers_url":"https://api.github.com/users/eroispaziali/followers","following_url":"https://api.github.com/users/eroispaziali/following{/other_user}","gists_url":"https://api.github.com/users/eroispaziali/gists{/gist_id}","starred_url":"https://api.github.com/users/eroispaziali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroispaziali/subscriptions","organizations_url":"https://api.github.com/users/eroispaziali/orgs","repos_url":"https://api.github.com/users/eroispaziali/repos","events_url":"https://api.github.com/users/eroispaziali/events{/privacy}","received_events_url":"https://api.github.com/users/eroispaziali/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eroispaziali/silly-repo","description":"This repo is just for testing GitHub APIs","fork":false,"url":"https://api.github.com/repos/eroispaziali/silly-repo","forks_url":"https://api.github.com/repos/eroispaziali/silly-repo/forks","keys_url":"https://api.github.com/repos/eroispaziali/silly-repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eroispaziali/silly-repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eroispaziali/silly-repo/teams","hooks_url":"https://api.github.com/repos/eroispaziali/silly-repo/hooks","issue_events_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues/events{/number}","events_url":"https://api.github.com/repos/eroispaziali/silly-repo/events","assignees_url":"https://api.github.com/repos/eroispaziali/silly-repo/assignees{/user}","branches_url":"https://api.github.com/repos/eroispaziali/silly-repo/branches{/branch}","tags_url":"https://api.github.com/repos/eroispaziali/silly-repo/tags","blobs_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eroispaziali/silly-repo/statuses/{sha}","languages_url":"https://api.github.com/repos/eroispaziali/silly-repo/languages","stargazers_url":"https://api.github.com/repos/eroispaziali/silly-repo/stargazers","contributors_url":"https://api.github.com/repos/eroispaziali/silly-repo/contributors","subscribers_url":"https://api.github.com/repos/eroispaziali/silly-repo/subscribers","subscription_url":"https://api.github.com/repos/eroispaziali/silly-repo/subscription","commits_url":"https://api.github.com/repos/eroispaziali/silly-repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/eroispaziali/silly-repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/eroispaziali/silly-repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/eroispaziali/silly-repo/contents/{+path}","compare_url":"https://api.github.com/repos/eroispaziali/silly-repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eroispaziali/silly-repo/merges","archive_url":"https://api.github.com/repos/eroispaziali/silly-repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eroispaziali/silly-repo/downloads","issues_url":"https://api.github.com/repos/eroispaziali/silly-repo/issues{/number}","pulls_url":"https://api.github.com/repos/eroispaziali/silly-repo/pulls{/number}","milestones_url":"https://api.github.com/repos/eroispaziali/silly-repo/milestones{/number}","notifications_url":"https://api.github.com/repos/eroispaziali/silly-repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eroispaziali/silly-repo/labels{/name}","releases_url":"https://api.github.com/repos/eroispaziali/silly-repo/releases{/id}","deployments_url":"https://api.github.com/repos/eroispaziali/silly-repo/deployments","created_at":"2016-04-18T14:02:28Z","updated_at":"2016-04-20T18:49:34Z","pushed_at":"2016-04-29T14:46:07Z","git_url":"git://github.com/eroispaziali/silly-repo.git","ssh_url":"git@github.com:eroispaziali/silly-repo.git","clone_url":"https://github.com/eroispaziali/silly-repo.git","svn_url":"https://github.com/eroispaziali/silly-repo","homepage":null,"size":2487,"stargazers_count":0,"watchers_count":0,"language":"Apex","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/eroispaziali/silly-repo/pulls/5"},"html":{"href":"https://github.com/eroispaziali/silly-repo/pull/5"},"issue":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/issues/5"},"comments":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/eroispaziali/silly-repo/statuses/714c08cfff4b74a7e823ac4b37b4156817224b7e"}}}}