{"action":"created","comment":{"url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments/54910888","id":54910888,"diff_hunk":"@@ -31,10 +64,27 @@ def create\n   end\n \n   def edit\n-    @volunteer_op = VolunteerOp.find(params[:id])\n+    @volunteer_ops = VolunteerOp.where(id: params[:id])\n+    @volunteer_op = @volunteer_ops.first\n     organisations = Organisation.where(id: @volunteer_op.organisation_id)\n     @organisation = organisations.first!\n-    @markers = build_map_markers(organisations)\n+\n+    @markers = Gmaps4rails.build_markers(@volunteer_ops) do |volop, marker|\n+      marker.lat volop.latitude.nil? ? volop.organisation.latitude : volop.latitude\n+      marker.lng volop.longitude.nil? ? volop.organisation.longitude : volop.longitude\n+      marker.infowindow render_to_string(partial: \"popup_#{volop.source}\", locals: { volop: volop })\n+      marker.json(\n+        custom_marker: render_to_string(\n+          partial: 'shared/custom_marker',\n+          locals: { attrs: [ActionController::Base.helpers.asset_path(\"volunteer_icon_#{volop.source}.png\"),\n+                            'data-id' => volop.id,\n+                            class: 'vol_op',\n+                            title: \"Click here to see volunteer opportunities at #{volop.title}\"]}","path":"app/controllers/volunteer_ops_controller.rb","position":75,"original_position":75,"commit_id":"0b5383ce046e99240a866fe65258bf197b0e34c0","original_commit_id":"0b5383ce046e99240a866fe65258bf197b0e34c0","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Metrics/LineLength: Line is too long. [98/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)","created_at":"2016-03-03T17:02:53Z","updated_at":"2016-03-03T17:02:53Z","html_url":"https://github.com/AgileVentures/LocalSupport/pull/261#discussion_r54910888","pull_request_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261","_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments/54910888"},"html":{"href":"https://github.com/AgileVentures/LocalSupport/pull/261#discussion_r54910888"},"pull_request":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261"}}},"pull_request":{"url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261","id":60498780,"html_url":"https://github.com/AgileVentures/LocalSupport/pull/261","diff_url":"https://github.com/AgileVentures/LocalSupport/pull/261.diff","patch_url":"https://github.com/AgileVentures/LocalSupport/pull/261.patch","issue_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/261","number":261,"state":"open","locked":false,"title":"adds test driven draft of ListOrganisationsWithVolunteerOps service","user":{"login":"tansaku","id":30216,"avatar_url":"https://avatars.githubusercontent.com/u/30216?v=3","gravatar_id":"","url":"https://api.github.com/users/tansaku","html_url":"https://github.com/tansaku","followers_url":"https://api.github.com/users/tansaku/followers","following_url":"https://api.github.com/users/tansaku/following{/other_user}","gists_url":"https://api.github.com/users/tansaku/gists{/gist_id}","starred_url":"https://api.github.com/users/tansaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tansaku/subscriptions","organizations_url":"https://api.github.com/users/tansaku/orgs","repos_url":"https://api.github.com/users/tansaku/repos","events_url":"https://api.github.com/users/tansaku/events{/privacy}","received_events_url":"https://api.github.com/users/tansaku/received_events","type":"User","site_admin":false},"body":"So this is a first step to have the do-it ops stored in the DB under active record, something that @ZmagoD and I have been talking about collaborating on via Github pong over a pull request, e.g. this one! :-)\r\n\r\nThis pull request starts with creating a CRUD service to list organizations with volunteer ops for use in the volunteer_ops controller (in the first instance).  The service is isolated from any dependencies using dependency injection, so its unit tests are fast, and the service can in principle be used outside rails (?)\r\n\r\nRemoving all the do-it components makes it feel that a service could be overkill here, but let's push forward that way and see.   The complexity of build_map_markers also makes me concerned.  It's unclear to me how to straighten that out.\r\n\r\nAnyhow, focusing on refactoring the do-it volups to use AR the next steps are probably\r\n\r\n* [x] create migration to add source and at least url(?) to the volunteer ops table\r\n* adjust the vol ops index controller method to pass in the correct scope depending on the feature flag setting NOT CLEAR IF NEEDED\r\n* [x] create a task to import some do-it volunteer ops into the database (and tests for that task) \r\n* [ ] removing the extraneous ListVolunteerOps service\r\n","created_at":"2016-02-24T12:07:05Z","updated_at":"2016-03-03T17:02:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c4bfbb3ecc26a27e18cae63936daa526213c6d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261/commits","review_comments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261/comments","review_comment_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/261/comments","statuses_url":"https://api.github.com/repos/AgileVentures/LocalSupport/statuses/0b5383ce046e99240a866fe65258bf197b0e34c0","head":{"label":"AgileVentures:113613673_refactor_do_it_vol_ops_to_active_record","ref":"113613673_refactor_do_it_vol_ops_to_active_record","sha":"0b5383ce046e99240a866fe65258bf197b0e34c0","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":14499588,"name":"LocalSupport","full_name":"AgileVentures/LocalSupport","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/LocalSupport","description":"A directory of local support services and volunteer opportunities","fork":true,"url":"https://api.github.com/repos/AgileVentures/LocalSupport","forks_url":"https://api.github.com/repos/AgileVentures/LocalSupport/forks","keys_url":"https://api.github.com/repos/AgileVentures/LocalSupport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/LocalSupport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/LocalSupport/teams","hooks_url":"https://api.github.com/repos/AgileVentures/LocalSupport/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/LocalSupport/events","assignees_url":"https://api.github.com/repos/AgileVentures/LocalSupport/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/LocalSupport/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/LocalSupport/tags","blobs_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/LocalSupport/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/LocalSupport/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/LocalSupport/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/LocalSupport/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/LocalSupport/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/LocalSupport/subscription","commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/comments{/number}","contents_url":"https://api.github.com/repos/AgileVentures/LocalSupport/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/LocalSupport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/LocalSupport/merges","archive_url":"https://api.github.com/repos/AgileVentures/LocalSupport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/LocalSupport/downloads","issues_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/LocalSupport/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/LocalSupport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/LocalSupport/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/LocalSupport/releases{/id}","deployments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/deployments","created_at":"2013-11-18T17:24:59Z","updated_at":"2015-12-27T12:23:55Z","pushed_at":"2016-03-03T17:02:42Z","git_url":"git://github.com/AgileVentures/LocalSupport.git","ssh_url":"git@github.com:AgileVentures/LocalSupport.git","clone_url":"https://github.com/AgileVentures/LocalSupport.git","svn_url":"https://github.com/AgileVentures/LocalSupport","homepage":"http://www.harrowcn.org.uk","size":55595,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":12,"forks":77,"open_issues":12,"watchers":15,"default_branch":"develop"}},"base":{"label":"AgileVentures:develop","ref":"develop","sha":"3e03930d7165980e248525559ea76e9ef09d2d10","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":14499588,"name":"LocalSupport","full_name":"AgileVentures/LocalSupport","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/LocalSupport","description":"A directory of local support services and volunteer opportunities","fork":true,"url":"https://api.github.com/repos/AgileVentures/LocalSupport","forks_url":"https://api.github.com/repos/AgileVentures/LocalSupport/forks","keys_url":"https://api.github.com/repos/AgileVentures/LocalSupport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/LocalSupport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/LocalSupport/teams","hooks_url":"https://api.github.com/repos/AgileVentures/LocalSupport/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/LocalSupport/events","assignees_url":"https://api.github.com/repos/AgileVentures/LocalSupport/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/LocalSupport/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/LocalSupport/tags","blobs_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/LocalSupport/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/LocalSupport/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/LocalSupport/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/LocalSupport/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/LocalSupport/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/LocalSupport/subscription","commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/LocalSupport/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/comments{/number}","contents_url":"https://api.github.com/repos/AgileVentures/LocalSupport/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/LocalSupport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/LocalSupport/merges","archive_url":"https://api.github.com/repos/AgileVentures/LocalSupport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/LocalSupport/downloads","issues_url":"https://api.github.com/repos/AgileVentures/LocalSupport/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/LocalSupport/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/LocalSupport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/LocalSupport/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/LocalSupport/releases{/id}","deployments_url":"https://api.github.com/repos/AgileVentures/LocalSupport/deployments","created_at":"2013-11-18T17:24:59Z","updated_at":"2015-12-27T12:23:55Z","pushed_at":"2016-03-03T17:02:42Z","git_url":"git://github.com/AgileVentures/LocalSupport.git","ssh_url":"git@github.com:AgileVentures/LocalSupport.git","clone_url":"https://github.com/AgileVentures/LocalSupport.git","svn_url":"https://github.com/AgileVentures/LocalSupport","homepage":"http://www.harrowcn.org.uk","size":55595,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":12,"forks":77,"open_issues":12,"watchers":15,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261"},"html":{"href":"https://github.com/AgileVentures/LocalSupport/pull/261"},"issue":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/261"},"comments":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/issues/261/comments"},"review_comments":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261/comments"},"review_comment":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/pulls/261/commits"},"statuses":{"href":"https://api.github.com/repos/AgileVentures/LocalSupport/statuses/0b5383ce046e99240a866fe65258bf197b0e34c0"}}}}