{"action":"created","comment":{"url":"https://api.github.com/repos/sc0v/binder-app/pulls/comments/179898899","pull_request_review_id":110236217,"id":179898899,"diff_hunk":"@@ -37,23 +38,39 @@ def duration\n     return DateTime.now.to_i - started_at.to_i\n   end\n \n+  def already_in_queue?\n+    ['structural', 'electrical'].include?(entry_type) &&\n+      !organization.organization_timeline_entries.current.send(entry_type).empty?\n+  end\n+\n   #notifcations \n-  after_create :notifyStart\n+  after_create :notifyStart, :notify_booth_committee\n   after_update :notifyEnd\n \n   def notifyStart\n-    for chair in organization.booth_chairs\n-      if chair.phone_number.length == 10\n-        send_sms(chair.phone_number, \"Downtime for your organization, \" +organization.name+\", has started.\")\n+    if entry_type == 'downtime'\n+      for chair in organization.booth_chairs\n+        if chair.phone_number.length == 10\n+          send_sms(chair.phone_number, \"Downtime for your organization, \" +organization.name+\", has started.\")\n+        end\n       end\n     end\n   end\n \n   def notifyEnd\n-    for chair in organization.booth_chairs\n-      if chair.phone_number.length == 10\n-        send_sms(chair.phone_number, \"Downtime for your organization, \" +organization.name+\", has ended. You have \"+Time.at(organization.remaining_downtime).utc.strftime(\"%H hours %M minutes\")+\" left.\")\n+    if entry_type == 'downtime'\n+      for chair in organization.booth_chairs\n+        if chair.phone_number.length == 10\n+          send_sms(chair.phone_number, \"Downtime for your organization, \" +organization.name+\", has ended. You have \"+Time.at(organization.remaining_downtime).utc.strftime(\"%H hours %M minutes\")+\" left.\")\n+        end\n       end\n     end\n   end\n-end\n\\ No newline at end of file\n+\n+  def notify_booth_committee\n+    # post in the booth committee groupme when someone joins a queue\n+    if ['structural', 'electrical'].include?(entry_type)\n+      send_groupme(\"8a6cab13d71d09562023b48658\",\"#{entry_type.titlecase} Queue: #{organization.short_name} needs #{description}\")","path":"app/models/organization_timeline_entry.rb","position":53,"original_position":53,"commit_id":"1a989b7133398483655163eee297b663a996a92c","original_commit_id":"1a989b7133398483655163eee297b663a996a92c","user":{"login":"agotsis","id":15185609,"avatar_url":"https://avatars0.githubusercontent.com/u/15185609?v=4","gravatar_id":"","url":"https://api.github.com/users/agotsis","html_url":"https://github.com/agotsis","followers_url":"https://api.github.com/users/agotsis/followers","following_url":"https://api.github.com/users/agotsis/following{/other_user}","gists_url":"https://api.github.com/users/agotsis/gists{/gist_id}","starred_url":"https://api.github.com/users/agotsis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agotsis/subscriptions","organizations_url":"https://api.github.com/users/agotsis/orgs","repos_url":"https://api.github.com/users/agotsis/repos","events_url":"https://api.github.com/users/agotsis/events{/privacy}","received_events_url":"https://api.github.com/users/agotsis/received_events","type":"User","site_admin":false},"body":"Please notify the electrical groupMe of electrical queue additions here as well.","created_at":"2018-04-06T23:50:04Z","updated_at":"2018-04-06T23:50:31Z","html_url":"https://github.com/sc0v/binder-app/pull/271#discussion_r179898899","pull_request_url":"https://api.github.com/repos/sc0v/binder-app/pulls/271","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sc0v/binder-app/pulls/comments/179898899"},"html":{"href":"https://github.com/sc0v/binder-app/pull/271#discussion_r179898899"},"pull_request":{"href":"https://api.github.com/repos/sc0v/binder-app/pulls/271"}}},"pull_request":{"url":"https://api.github.com/repos/sc0v/binder-app/pulls/271","id":179853190,"html_url":"https://github.com/sc0v/binder-app/pull/271","diff_url":"https://github.com/sc0v/binder-app/pull/271.diff","patch_url":"https://github.com/sc0v/binder-app/pull/271.patch","issue_url":"https://api.github.com/repos/sc0v/binder-app/issues/271","number":271,"state":"open","locked":false,"title":"Queues and downtime","user":{"login":"aperley","id":1293417,"avatar_url":"https://avatars0.githubusercontent.com/u/1293417?v=4","gravatar_id":"","url":"https://api.github.com/users/aperley","html_url":"https://github.com/aperley","followers_url":"https://api.github.com/users/aperley/followers","following_url":"https://api.github.com/users/aperley/following{/other_user}","gists_url":"https://api.github.com/users/aperley/gists{/gist_id}","starred_url":"https://api.github.com/users/aperley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aperley/subscriptions","organizations_url":"https://api.github.com/users/aperley/orgs","repos_url":"https://api.github.com/users/aperley/repos","events_url":"https://api.github.com/users/aperley/events{/privacy}","received_events_url":"https://api.github.com/users/aperley/received_events","type":"User","site_admin":false},"body":"- Only send SMS on organization timeline entry creation/end if type is downtime\r\n- Allow any signed in user to view structural and electrical queues\r\n- Allow booth chairs to create/end structural and electrical organization timeline entries for their organizations\r\n- Add links to structural and electrical queues in quick links and nav bar","created_at":"2018-04-06T04:40:14Z","updated_at":"2018-04-06T23:50:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf14609764c492a87d59e02566939970c0b3182f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sc0v/binder-app/pulls/271/commits","review_comments_url":"https://api.github.com/repos/sc0v/binder-app/pulls/271/comments","review_comment_url":"https://api.github.com/repos/sc0v/binder-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sc0v/binder-app/issues/271/comments","statuses_url":"https://api.github.com/repos/sc0v/binder-app/statuses/1a989b7133398483655163eee297b663a996a92c","head":{"label":"sc0v:queues-and-downtime","ref":"queues-and-downtime","sha":"1a989b7133398483655163eee297b663a996a92c","user":{"login":"sc0v","id":3598772,"avatar_url":"https://avatars2.githubusercontent.com/u/3598772?v=4","gravatar_id":"","url":"https://api.github.com/users/sc0v","html_url":"https://github.com/sc0v","followers_url":"https://api.github.com/users/sc0v/followers","following_url":"https://api.github.com/users/sc0v/following{/other_user}","gists_url":"https://api.github.com/users/sc0v/gists{/gist_id}","starred_url":"https://api.github.com/users/sc0v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sc0v/subscriptions","organizations_url":"https://api.github.com/users/sc0v/orgs","repos_url":"https://api.github.com/users/sc0v/repos","events_url":"https://api.github.com/users/sc0v/events{/privacy}","received_events_url":"https://api.github.com/users/sc0v/received_events","type":"Organization","site_admin":false},"repo":{"id":8633218,"name":"binder-app","full_name":"sc0v/binder-app","owner":{"login":"sc0v","id":3598772,"avatar_url":"https://avatars2.githubusercontent.com/u/3598772?v=4","gravatar_id":"","url":"https://api.github.com/users/sc0v","html_url":"https://github.com/sc0v","followers_url":"https://api.github.com/users/sc0v/followers","following_url":"https://api.github.com/users/sc0v/following{/other_user}","gists_url":"https://api.github.com/users/sc0v/gists{/gist_id}","starred_url":"https://api.github.com/users/sc0v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sc0v/subscriptions","organizations_url":"https://api.github.com/users/sc0v/orgs","repos_url":"https://api.github.com/users/sc0v/repos","events_url":"https://api.github.com/users/sc0v/events{/privacy}","received_events_url":"https://api.github.com/users/sc0v/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sc0v/binder-app","description":"The Spring Carnival managment application built for Carnegie Mellon Spring Carnival.","fork":false,"url":"https://api.github.com/repos/sc0v/binder-app","forks_url":"https://api.github.com/repos/sc0v/binder-app/forks","keys_url":"https://api.github.com/repos/sc0v/binder-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sc0v/binder-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sc0v/binder-app/teams","hooks_url":"https://api.github.com/repos/sc0v/binder-app/hooks","issue_events_url":"https://api.github.com/repos/sc0v/binder-app/issues/events{/number}","events_url":"https://api.github.com/repos/sc0v/binder-app/events","assignees_url":"https://api.github.com/repos/sc0v/binder-app/assignees{/user}","branches_url":"https://api.github.com/repos/sc0v/binder-app/branches{/branch}","tags_url":"https://api.github.com/repos/sc0v/binder-app/tags","blobs_url":"https://api.github.com/repos/sc0v/binder-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sc0v/binder-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sc0v/binder-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/sc0v/binder-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sc0v/binder-app/statuses/{sha}","languages_url":"https://api.github.com/repos/sc0v/binder-app/languages","stargazers_url":"https://api.github.com/repos/sc0v/binder-app/stargazers","contributors_url":"https://api.github.com/repos/sc0v/binder-app/contributors","subscribers_url":"https://api.github.com/repos/sc0v/binder-app/subscribers","subscription_url":"https://api.github.com/repos/sc0v/binder-app/subscription","commits_url":"https://api.github.com/repos/sc0v/binder-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/sc0v/binder-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/sc0v/binder-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/sc0v/binder-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/sc0v/binder-app/contents/{+path}","compare_url":"https://api.github.com/repos/sc0v/binder-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sc0v/binder-app/merges","archive_url":"https://api.github.com/repos/sc0v/binder-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sc0v/binder-app/downloads","issues_url":"https://api.github.com/repos/sc0v/binder-app/issues{/number}","pulls_url":"https://api.github.com/repos/sc0v/binder-app/pulls{/number}","milestones_url":"https://api.github.com/repos/sc0v/binder-app/milestones{/number}","notifications_url":"https://api.github.com/repos/sc0v/binder-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sc0v/binder-app/labels{/name}","releases_url":"https://api.github.com/repos/sc0v/binder-app/releases{/id}","deployments_url":"https://api.github.com/repos/sc0v/binder-app/deployments","created_at":"2013-03-07T17:57:10Z","updated_at":"2018-04-06T22:59:04Z","pushed_at":"2018-04-06T22:59:03Z","git_url":"git://github.com/sc0v/binder-app.git","ssh_url":"git@github.com:sc0v/binder-app.git","clone_url":"https://github.com/sc0v/binder-app.git","svn_url":"https://github.com/sc0v/binder-app","homepage":"","size":15668,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":44,"license":null,"forks":9,"open_issues":44,"watchers":13,"default_branch":"master"}},"base":{"label":"sc0v:master","ref":"master","sha":"5a2cacd409f90fe83f8a45c1ac600294863a3982","user":{"login":"sc0v","id":3598772,"avatar_url":"https://avatars2.githubusercontent.com/u/3598772?v=4","gravatar_id":"","url":"https://api.github.com/users/sc0v","html_url":"https://github.com/sc0v","followers_url":"https://api.github.com/users/sc0v/followers","following_url":"https://api.github.com/users/sc0v/following{/other_user}","gists_url":"https://api.github.com/users/sc0v/gists{/gist_id}","starred_url":"https://api.github.com/users/sc0v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sc0v/subscriptions","organizations_url":"https://api.github.com/users/sc0v/orgs","repos_url":"https://api.github.com/users/sc0v/repos","events_url":"https://api.github.com/users/sc0v/events{/privacy}","received_events_url":"https://api.github.com/users/sc0v/received_events","type":"Organization","site_admin":false},"repo":{"id":8633218,"name":"binder-app","full_name":"sc0v/binder-app","owner":{"login":"sc0v","id":3598772,"avatar_url":"https://avatars2.githubusercontent.com/u/3598772?v=4","gravatar_id":"","url":"https://api.github.com/users/sc0v","html_url":"https://github.com/sc0v","followers_url":"https://api.github.com/users/sc0v/followers","following_url":"https://api.github.com/users/sc0v/following{/other_user}","gists_url":"https://api.github.com/users/sc0v/gists{/gist_id}","starred_url":"https://api.github.com/users/sc0v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sc0v/subscriptions","organizations_url":"https://api.github.com/users/sc0v/orgs","repos_url":"https://api.github.com/users/sc0v/repos","events_url":"https://api.github.com/users/sc0v/events{/privacy}","received_events_url":"https://api.github.com/users/sc0v/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sc0v/binder-app","description":"The Spring Carnival managment application built for Carnegie Mellon Spring Carnival.","fork":false,"url":"https://api.github.com/repos/sc0v/binder-app","forks_url":"https://api.github.com/repos/sc0v/binder-app/forks","keys_url":"https://api.github.com/repos/sc0v/binder-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sc0v/binder-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sc0v/binder-app/teams","hooks_url":"https://api.github.com/repos/sc0v/binder-app/hooks","issue_events_url":"https://api.github.com/repos/sc0v/binder-app/issues/events{/number}","events_url":"https://api.github.com/repos/sc0v/binder-app/events","assignees_url":"https://api.github.com/repos/sc0v/binder-app/assignees{/user}","branches_url":"https://api.github.com/repos/sc0v/binder-app/branches{/branch}","tags_url":"https://api.github.com/repos/sc0v/binder-app/tags","blobs_url":"https://api.github.com/repos/sc0v/binder-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sc0v/binder-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sc0v/binder-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/sc0v/binder-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sc0v/binder-app/statuses/{sha}","languages_url":"https://api.github.com/repos/sc0v/binder-app/languages","stargazers_url":"https://api.github.com/repos/sc0v/binder-app/stargazers","contributors_url":"https://api.github.com/repos/sc0v/binder-app/contributors","subscribers_url":"https://api.github.com/repos/sc0v/binder-app/subscribers","subscription_url":"https://api.github.com/repos/sc0v/binder-app/subscription","commits_url":"https://api.github.com/repos/sc0v/binder-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/sc0v/binder-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/sc0v/binder-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/sc0v/binder-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/sc0v/binder-app/contents/{+path}","compare_url":"https://api.github.com/repos/sc0v/binder-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sc0v/binder-app/merges","archive_url":"https://api.github.com/repos/sc0v/binder-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sc0v/binder-app/downloads","issues_url":"https://api.github.com/repos/sc0v/binder-app/issues{/number}","pulls_url":"https://api.github.com/repos/sc0v/binder-app/pulls{/number}","milestones_url":"https://api.github.com/repos/sc0v/binder-app/milestones{/number}","notifications_url":"https://api.github.com/repos/sc0v/binder-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sc0v/binder-app/labels{/name}","releases_url":"https://api.github.com/repos/sc0v/binder-app/releases{/id}","deployments_url":"https://api.github.com/repos/sc0v/binder-app/deployments","created_at":"2013-03-07T17:57:10Z","updated_at":"2018-04-06T22:59:04Z","pushed_at":"2018-04-06T22:59:03Z","git_url":"git://github.com/sc0v/binder-app.git","ssh_url":"git@github.com:sc0v/binder-app.git","clone_url":"https://github.com/sc0v/binder-app.git","svn_url":"https://github.com/sc0v/binder-app","homepage":"","size":15668,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":44,"license":null,"forks":9,"open_issues":44,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sc0v/binder-app/pulls/271"},"html":{"href":"https://github.com/sc0v/binder-app/pull/271"},"issue":{"href":"https://api.github.com/repos/sc0v/binder-app/issues/271"},"comments":{"href":"https://api.github.com/repos/sc0v/binder-app/issues/271/comments"},"review_comments":{"href":"https://api.github.com/repos/sc0v/binder-app/pulls/271/comments"},"review_comment":{"href":"https://api.github.com/repos/sc0v/binder-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sc0v/binder-app/pulls/271/commits"},"statuses":{"href":"https://api.github.com/repos/sc0v/binder-app/statuses/1a989b7133398483655163eee297b663a996a92c"}},"author_association":"NONE"}}
{"actor":{"display_login":"agotsis"}}