{"action":"created","issue":{"url":"https://api.github.com/repos/jarektkaczyk/hookable/issues/1","labels_url":"https://api.github.com/repos/jarektkaczyk/hookable/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jarektkaczyk/hookable/issues/1/comments","events_url":"https://api.github.com/repos/jarektkaczyk/hookable/issues/1/events","html_url":"https://github.com/jarektkaczyk/hookable/pull/1","id":119665585,"number":1,"title":"Add a method to remove all hooks","user":{"login":"jonruttan","id":2718602,"avatar_url":"https://avatars.githubusercontent.com/u/2718602?v=3","gravatar_id":"","url":"https://api.github.com/users/jonruttan","html_url":"https://github.com/jonruttan","followers_url":"https://api.github.com/users/jonruttan/followers","following_url":"https://api.github.com/users/jonruttan/following{/other_user}","gists_url":"https://api.github.com/users/jonruttan/gists{/gist_id}","starred_url":"https://api.github.com/users/jonruttan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonruttan/subscriptions","organizations_url":"https://api.github.com/users/jonruttan/orgs","repos_url":"https://api.github.com/users/jonruttan/repos","events_url":"https://api.github.com/users/jonruttan/events{/privacy}","received_events_url":"https://api.github.com/users/jonruttan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-01T08:22:39Z","updated_at":"2015-12-01T09:09:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jarektkaczyk/hookable/pulls/1","html_url":"https://github.com/jarektkaczyk/hookable/pull/1","diff_url":"https://github.com/jarektkaczyk/hookable/pull/1.diff","patch_url":"https://github.com/jarektkaczyk/hookable/pull/1.patch"},"body":"This change adds a *flushHooks* method to the trait, which removes all of the hooks from the model.\r\n\r\nI added this because when running unit tests on models using the *Mappable* trait from <https://github.com/jarektkaczyk/eloquence> the hooks are repeatedly added and after running a number of tests eventually the call stack grows to a point where it exceeds the [xdebug maximum depth](http://xdebug.org/docs/all_settings#var_display_max_depth) causing the tests to crash. This can be circumvented by flushing the hooks in the *TestCase* *setUp* method, or by calling it before adding the hooks in *Mappable's* *bootMappable* method."},"comment":{"url":"https://api.github.com/repos/jarektkaczyk/hookable/issues/comments/160901071","html_url":"https://github.com/jarektkaczyk/hookable/pull/1#issuecomment-160901071","issue_url":"https://api.github.com/repos/jarektkaczyk/hookable/issues/1","id":160901071,"user":{"login":"jonruttan","id":2718602,"avatar_url":"https://avatars.githubusercontent.com/u/2718602?v=3","gravatar_id":"","url":"https://api.github.com/users/jonruttan","html_url":"https://github.com/jonruttan","followers_url":"https://api.github.com/users/jonruttan/followers","following_url":"https://api.github.com/users/jonruttan/following{/other_user}","gists_url":"https://api.github.com/users/jonruttan/gists{/gist_id}","starred_url":"https://api.github.com/users/jonruttan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonruttan/subscriptions","organizations_url":"https://api.github.com/users/jonruttan/orgs","repos_url":"https://api.github.com/users/jonruttan/repos","events_url":"https://api.github.com/users/jonruttan/events{/privacy}","received_events_url":"https://api.github.com/users/jonruttan/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T09:09:55Z","updated_at":"2015-12-01T09:09:55Z","body":"The commits have been squashed."}}