{"action":"created","comment":{"url":"https://api.github.com/repos/stevematney/valour/pulls/comments/50460269","id":50460269,"diff_hunk":"@@ -121,6 +121,15 @@ class Valour {\n     });\n     this.runCallbacks(name);\n   }\n+\n+  disposeForm(name) {\n+    this.forms[name] = {};\n+  }\n+\n+  removeValidation(formName, key) {\n+    let form = this.getForm(formName);\n+    delete form[key];","path":"src/valour.js","position":11,"original_position":11,"commit_id":"a181782425d96b4e97f145628ffa9139b32eb81b","original_commit_id":"a181782425d96b4e97f145628ffa9139b32eb81b","user":{"login":"stevematney","id":1235376,"avatar_url":"https://avatars.githubusercontent.com/u/1235376?v=3","gravatar_id":"","url":"https://api.github.com/users/stevematney","html_url":"https://github.com/stevematney","followers_url":"https://api.github.com/users/stevematney/followers","following_url":"https://api.github.com/users/stevematney/following{/other_user}","gists_url":"https://api.github.com/users/stevematney/gists{/gist_id}","starred_url":"https://api.github.com/users/stevematney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevematney/subscriptions","organizations_url":"https://api.github.com/users/stevematney/orgs","repos_url":"https://api.github.com/users/stevematney/repos","events_url":"https://api.github.com/users/stevematney/events{/privacy}","received_events_url":"https://api.github.com/users/stevematney/received_events","type":"User","site_admin":false},"body":"I think I'd rather see this written as a new form object as opposed to mutating the existing form. So something like\r\n```javascript\r\nthis.forms[name] = Object.keys(this.getForm(formName)).reduce((newForm, key) => ..., {})\r\n```","created_at":"2016-01-21T20:38:54Z","updated_at":"2016-01-21T20:38:54Z","html_url":"https://github.com/stevematney/valour/pull/24#discussion_r50460269","pull_request_url":"https://api.github.com/repos/stevematney/valour/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/stevematney/valour/pulls/comments/50460269"},"html":{"href":"https://github.com/stevematney/valour/pull/24#discussion_r50460269"},"pull_request":{"href":"https://api.github.com/repos/stevematney/valour/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/stevematney/valour/pulls/24","id":56804347,"html_url":"https://github.com/stevematney/valour/pull/24","diff_url":"https://github.com/stevematney/valour/pull/24.diff","patch_url":"https://github.com/stevematney/valour/pull/24.patch","issue_url":"https://api.github.com/repos/stevematney/valour/issues/24","number":24,"state":"open","locked":false,"title":"New rule and new functions for removing validation.","user":{"login":"JosephDSchwartz","id":6923910,"avatar_url":"https://avatars.githubusercontent.com/u/6923910?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephDSchwartz","html_url":"https://github.com/JosephDSchwartz","followers_url":"https://api.github.com/users/JosephDSchwartz/followers","following_url":"https://api.github.com/users/JosephDSchwartz/following{/other_user}","gists_url":"https://api.github.com/users/JosephDSchwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephDSchwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephDSchwartz/subscriptions","organizations_url":"https://api.github.com/users/JosephDSchwartz/orgs","repos_url":"https://api.github.com/users/JosephDSchwartz/repos","events_url":"https://api.github.com/users/JosephDSchwartz/events{/privacy}","received_events_url":"https://api.github.com/users/JosephDSchwartz/received_events","type":"User","site_admin":false},"body":"1) Added the isRequiredWhen rule that mimics the behavior of the isRequired rule, but allows for the flexibility of choosing when something is required.\r\n\r\n2) Added two functions to valour for removing validation.  One allows for removing a particular key from the form (removeValidation).  The other blows away the whole form (disposeForm).","created_at":"2016-01-21T20:27:55Z","updated_at":"2016-01-21T20:38:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a318c0f5d7d670f4edf284b2b89c1f10455d2bb9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stevematney/valour/pulls/24/commits","review_comments_url":"https://api.github.com/repos/stevematney/valour/pulls/24/comments","review_comment_url":"https://api.github.com/repos/stevematney/valour/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stevematney/valour/issues/24/comments","statuses_url":"https://api.github.com/repos/stevematney/valour/statuses/a181782425d96b4e97f145628ffa9139b32eb81b","head":{"label":"JosephDSchwartz:master","ref":"master","sha":"a181782425d96b4e97f145628ffa9139b32eb81b","user":{"login":"JosephDSchwartz","id":6923910,"avatar_url":"https://avatars.githubusercontent.com/u/6923910?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephDSchwartz","html_url":"https://github.com/JosephDSchwartz","followers_url":"https://api.github.com/users/JosephDSchwartz/followers","following_url":"https://api.github.com/users/JosephDSchwartz/following{/other_user}","gists_url":"https://api.github.com/users/JosephDSchwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephDSchwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephDSchwartz/subscriptions","organizations_url":"https://api.github.com/users/JosephDSchwartz/orgs","repos_url":"https://api.github.com/users/JosephDSchwartz/repos","events_url":"https://api.github.com/users/JosephDSchwartz/events{/privacy}","received_events_url":"https://api.github.com/users/JosephDSchwartz/received_events","type":"User","site_admin":false},"repo":{"id":46730226,"name":"valour","full_name":"JosephDSchwartz/valour","owner":{"login":"JosephDSchwartz","id":6923910,"avatar_url":"https://avatars.githubusercontent.com/u/6923910?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephDSchwartz","html_url":"https://github.com/JosephDSchwartz","followers_url":"https://api.github.com/users/JosephDSchwartz/followers","following_url":"https://api.github.com/users/JosephDSchwartz/following{/other_user}","gists_url":"https://api.github.com/users/JosephDSchwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephDSchwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephDSchwartz/subscriptions","organizations_url":"https://api.github.com/users/JosephDSchwartz/orgs","repos_url":"https://api.github.com/users/JosephDSchwartz/repos","events_url":"https://api.github.com/users/JosephDSchwartz/events{/privacy}","received_events_url":"https://api.github.com/users/JosephDSchwartz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JosephDSchwartz/valour","description":"The brave little validation tool.","fork":true,"url":"https://api.github.com/repos/JosephDSchwartz/valour","forks_url":"https://api.github.com/repos/JosephDSchwartz/valour/forks","keys_url":"https://api.github.com/repos/JosephDSchwartz/valour/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JosephDSchwartz/valour/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JosephDSchwartz/valour/teams","hooks_url":"https://api.github.com/repos/JosephDSchwartz/valour/hooks","issue_events_url":"https://api.github.com/repos/JosephDSchwartz/valour/issues/events{/number}","events_url":"https://api.github.com/repos/JosephDSchwartz/valour/events","assignees_url":"https://api.github.com/repos/JosephDSchwartz/valour/assignees{/user}","branches_url":"https://api.github.com/repos/JosephDSchwartz/valour/branches{/branch}","tags_url":"https://api.github.com/repos/JosephDSchwartz/valour/tags","blobs_url":"https://api.github.com/repos/JosephDSchwartz/valour/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JosephDSchwartz/valour/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JosephDSchwartz/valour/git/refs{/sha}","trees_url":"https://api.github.com/repos/JosephDSchwartz/valour/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JosephDSchwartz/valour/statuses/{sha}","languages_url":"https://api.github.com/repos/JosephDSchwartz/valour/languages","stargazers_url":"https://api.github.com/repos/JosephDSchwartz/valour/stargazers","contributors_url":"https://api.github.com/repos/JosephDSchwartz/valour/contributors","subscribers_url":"https://api.github.com/repos/JosephDSchwartz/valour/subscribers","subscription_url":"https://api.github.com/repos/JosephDSchwartz/valour/subscription","commits_url":"https://api.github.com/repos/JosephDSchwartz/valour/commits{/sha}","git_commits_url":"https://api.github.com/repos/JosephDSchwartz/valour/git/commits{/sha}","comments_url":"https://api.github.com/repos/JosephDSchwartz/valour/comments{/number}","issue_comment_url":"https://api.github.com/repos/JosephDSchwartz/valour/issues/comments{/number}","contents_url":"https://api.github.com/repos/JosephDSchwartz/valour/contents/{+path}","compare_url":"https://api.github.com/repos/JosephDSchwartz/valour/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JosephDSchwartz/valour/merges","archive_url":"https://api.github.com/repos/JosephDSchwartz/valour/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JosephDSchwartz/valour/downloads","issues_url":"https://api.github.com/repos/JosephDSchwartz/valour/issues{/number}","pulls_url":"https://api.github.com/repos/JosephDSchwartz/valour/pulls{/number}","milestones_url":"https://api.github.com/repos/JosephDSchwartz/valour/milestones{/number}","notifications_url":"https://api.github.com/repos/JosephDSchwartz/valour/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JosephDSchwartz/valour/labels{/name}","releases_url":"https://api.github.com/repos/JosephDSchwartz/valour/releases{/id}","created_at":"2015-11-23T15:43:24Z","updated_at":"2016-01-21T20:13:51Z","pushed_at":"2016-01-21T20:13:49Z","git_url":"git://github.com/JosephDSchwartz/valour.git","ssh_url":"git@github.com:JosephDSchwartz/valour.git","clone_url":"https://github.com/JosephDSchwartz/valour.git","svn_url":"https://github.com/JosephDSchwartz/valour","homepage":"","size":257,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"stevematney:master","ref":"master","sha":"a73f4fb7c997b682d301373def692cd7a7a0c71e","user":{"login":"stevematney","id":1235376,"avatar_url":"https://avatars.githubusercontent.com/u/1235376?v=3","gravatar_id":"","url":"https://api.github.com/users/stevematney","html_url":"https://github.com/stevematney","followers_url":"https://api.github.com/users/stevematney/followers","following_url":"https://api.github.com/users/stevematney/following{/other_user}","gists_url":"https://api.github.com/users/stevematney/gists{/gist_id}","starred_url":"https://api.github.com/users/stevematney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevematney/subscriptions","organizations_url":"https://api.github.com/users/stevematney/orgs","repos_url":"https://api.github.com/users/stevematney/repos","events_url":"https://api.github.com/users/stevematney/events{/privacy}","received_events_url":"https://api.github.com/users/stevematney/received_events","type":"User","site_admin":false},"repo":{"id":41313062,"name":"valour","full_name":"stevematney/valour","owner":{"login":"stevematney","id":1235376,"avatar_url":"https://avatars.githubusercontent.com/u/1235376?v=3","gravatar_id":"","url":"https://api.github.com/users/stevematney","html_url":"https://github.com/stevematney","followers_url":"https://api.github.com/users/stevematney/followers","following_url":"https://api.github.com/users/stevematney/following{/other_user}","gists_url":"https://api.github.com/users/stevematney/gists{/gist_id}","starred_url":"https://api.github.com/users/stevematney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevematney/subscriptions","organizations_url":"https://api.github.com/users/stevematney/orgs","repos_url":"https://api.github.com/users/stevematney/repos","events_url":"https://api.github.com/users/stevematney/events{/privacy}","received_events_url":"https://api.github.com/users/stevematney/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevematney/valour","description":"The brave little validation tool.","fork":false,"url":"https://api.github.com/repos/stevematney/valour","forks_url":"https://api.github.com/repos/stevematney/valour/forks","keys_url":"https://api.github.com/repos/stevematney/valour/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevematney/valour/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevematney/valour/teams","hooks_url":"https://api.github.com/repos/stevematney/valour/hooks","issue_events_url":"https://api.github.com/repos/stevematney/valour/issues/events{/number}","events_url":"https://api.github.com/repos/stevematney/valour/events","assignees_url":"https://api.github.com/repos/stevematney/valour/assignees{/user}","branches_url":"https://api.github.com/repos/stevematney/valour/branches{/branch}","tags_url":"https://api.github.com/repos/stevematney/valour/tags","blobs_url":"https://api.github.com/repos/stevematney/valour/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevematney/valour/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevematney/valour/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevematney/valour/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevematney/valour/statuses/{sha}","languages_url":"https://api.github.com/repos/stevematney/valour/languages","stargazers_url":"https://api.github.com/repos/stevematney/valour/stargazers","contributors_url":"https://api.github.com/repos/stevematney/valour/contributors","subscribers_url":"https://api.github.com/repos/stevematney/valour/subscribers","subscription_url":"https://api.github.com/repos/stevematney/valour/subscription","commits_url":"https://api.github.com/repos/stevematney/valour/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevematney/valour/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevematney/valour/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevematney/valour/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevematney/valour/contents/{+path}","compare_url":"https://api.github.com/repos/stevematney/valour/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevematney/valour/merges","archive_url":"https://api.github.com/repos/stevematney/valour/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevematney/valour/downloads","issues_url":"https://api.github.com/repos/stevematney/valour/issues{/number}","pulls_url":"https://api.github.com/repos/stevematney/valour/pulls{/number}","milestones_url":"https://api.github.com/repos/stevematney/valour/milestones{/number}","notifications_url":"https://api.github.com/repos/stevematney/valour/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevematney/valour/labels{/name}","releases_url":"https://api.github.com/repos/stevematney/valour/releases{/id}","created_at":"2015-08-24T16:02:45Z","updated_at":"2016-01-13T15:06:08Z","pushed_at":"2016-01-21T20:27:55Z","git_url":"git://github.com/stevematney/valour.git","ssh_url":"git@github.com:stevematney/valour.git","clone_url":"https://github.com/stevematney/valour.git","svn_url":"https://github.com/stevematney/valour","homepage":"","size":259,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stevematney/valour/pulls/24"},"html":{"href":"https://github.com/stevematney/valour/pull/24"},"issue":{"href":"https://api.github.com/repos/stevematney/valour/issues/24"},"comments":{"href":"https://api.github.com/repos/stevematney/valour/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/stevematney/valour/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/stevematney/valour/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stevematney/valour/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/stevematney/valour/statuses/a181782425d96b4e97f145628ffa9139b32eb81b"}}}}