{"action":"created","issue":{"url":"https://api.github.com/repos/piotrmurach/loaf/issues/24","repository_url":"https://api.github.com/repos/piotrmurach/loaf","labels_url":"https://api.github.com/repos/piotrmurach/loaf/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/piotrmurach/loaf/issues/24/comments","events_url":"https://api.github.com/repos/piotrmurach/loaf/issues/24/events","html_url":"https://github.com/piotrmurach/loaf/pull/24","id":334430575,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NDA0NTM0","number":24,"title":"Add breadcrumbs method","user":{"login":"brendon","id":81871,"node_id":"MDQ6VXNlcjgxODcx","avatar_url":"https://avatars3.githubusercontent.com/u/81871?v=4","gravatar_id":"","url":"https://api.github.com/users/brendon","html_url":"https://github.com/brendon","followers_url":"https://api.github.com/users/brendon/followers","following_url":"https://api.github.com/users/brendon/following{/other_user}","gists_url":"https://api.github.com/users/brendon/gists{/gist_id}","starred_url":"https://api.github.com/users/brendon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendon/subscriptions","organizations_url":"https://api.github.com/users/brendon/orgs","repos_url":"https://api.github.com/users/brendon/repos","events_url":"https://api.github.com/users/brendon/events{/privacy}","received_events_url":"https://api.github.com/users/brendon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-21T10:23:06Z","updated_at":"2018-06-21T10:30:04Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/piotrmurach/loaf/pulls/24","html_url":"https://github.com/piotrmurach/loaf/pull/24","diff_url":"https://github.com/piotrmurach/loaf/pull/24.diff","patch_url":"https://github.com/piotrmurach/loaf/pull/24.patch"},"body":"This one might seem like a weird requirement at first, but say I want to define several breadcrumbs at once (as in the case of recursive breadcrumbs). Using this patch I can do the following:\r\n\r\n```\r\nbreadcrumbs do\r\n  folder.ancestors.each do |ancestor|\r\n    breadcrumb ancestor.name, [:admin, ancestor, :contents]\r\n  end\r\nend\r\n```\r\n\r\nThis allows me to use instance methods (such as the ones `decent_exposure` provides) directly within the block (in this case `folder` is defined in the class as an instance method). It also works where the instance methods are defined in sub-classes and the `breadcrumbs` call is made in a superclass, allowing us to hand off the creation of that instance method to the sub-class. I think that last point works because of the use of `before_action`. It's a neat trick!\r\n\r\nI've given it some quick documentation but didn't know how to document the fact that it needs to be passed a block. I also couldn't think of where to test this. If you had some pointers for me that would be great, otherwise I'm happy for you to jump in and add some tests.\r\n\r\nI've actually tested this in my application and it works really well!\r\n\r\nFixes #23"},"comment":{"url":"https://api.github.com/repos/piotrmurach/loaf/issues/comments/399054730","html_url":"https://github.com/piotrmurach/loaf/pull/24#issuecomment-399054730","issue_url":"https://api.github.com/repos/piotrmurach/loaf/issues/24","id":399054730,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTA1NDczMA==","user":{"login":"coveralls","id":2354108,"node_id":"MDQ6VXNlcjIzNTQxMDg=","avatar_url":"https://avatars1.githubusercontent.com/u/2354108?v=4","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T10:30:04Z","updated_at":"2018-06-21T10:30:04Z","author_association":"NONE","body":"\n[![Coverage Status](https://coveralls.io/builds/17610957/badge)](https://coveralls.io/builds/17610957)\n\nCoverage decreased (-0.4%) to 96.226% when pulling **0dced98212539e8bddc8b3d304c87d732398f15f on brendon:breadcrumbs** into **bdc0930481e956b9004a5ea0fb4a156319be69fe on piotrmurach:master**.\n"}}
{"actor":{"display_login":"coveralls"}}