{"action":"created","comment":{"url":"https://api.github.com/repos/YaleSTC/reservations/pulls/comments/27896451","id":27896451,"diff_hunk":"@@ -56,32 +42,29 @@ def self.included(base) # rubocop:disable MethodLength, AbcSize\n       scope :ends_on_days, lambda { |start_date, end_date|\n         where(due_date: start_date..end_date)\n       }\n-      scope :reserved_on_date, ->(date) { overlaps_with_date(date).finalized }\n+      scope :reserved_on_date, lambda { |date|\n+        overlaps_with_date(date).not_available\n+      }\n       scope :for_eq_model, lambda { |eq_model|\n-        where(equipment_model_id: eq_model.id).finalized\n+        where(equipment_model_id: eq_model.id)\n       }\n       scope :active_or_requested, lambda {\n-        where('checked_in IS NULL and approval_status != ?', 'denied').recent\n+        where(status: Reservation.statuses.values_at(","path":"app/models/reservation_scopes.rb","position":85,"original_position":85,"commit_id":"be1e2abdc8804e3030f7690cfbda43fe62b94e19","original_commit_id":"be1e2abdc8804e3030f7690cfbda43fe62b94e19","user":{"login":"orenyk","id":901808,"avatar_url":"https://avatars.githubusercontent.com/u/901808?v=3","gravatar_id":"","url":"https://api.github.com/users/orenyk","html_url":"https://github.com/orenyk","followers_url":"https://api.github.com/users/orenyk/followers","following_url":"https://api.github.com/users/orenyk/following{/other_user}","gists_url":"https://api.github.com/users/orenyk/gists{/gist_id}","starred_url":"https://api.github.com/users/orenyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orenyk/subscriptions","organizations_url":"https://api.github.com/users/orenyk/orgs","repos_url":"https://api.github.com/users/orenyk/repos","events_url":"https://api.github.com/users/orenyk/events{/privacy}","received_events_url":"https://api.github.com/users/orenyk/received_events","type":"User","site_admin":false},"body":"Similar to `not_available`, I feel like this could be modified to `where(status: [:requested, :reserved, :checked_out])`.","created_at":"2015-04-07T16:48:48Z","updated_at":"2015-04-07T16:48:48Z","html_url":"https://github.com/YaleSTC/reservations/pull/1220#discussion_r27896451","pull_request_url":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220","_links":{"self":{"href":"https://api.github.com/repos/YaleSTC/reservations/pulls/comments/27896451"},"html":{"href":"https://github.com/YaleSTC/reservations/pull/1220#discussion_r27896451"},"pull_request":{"href":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220"}}},"pull_request":{"url":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220","id":32658215,"html_url":"https://github.com/YaleSTC/reservations/pull/1220","diff_url":"https://github.com/YaleSTC/reservations/pull/1220.diff","patch_url":"https://github.com/YaleSTC/reservations/pull/1220.patch","issue_url":"https://api.github.com/repos/YaleSTC/reservations/issues/1220","number":1220,"state":"open","locked":false,"title":"[462] status overhaul","user":{"login":"esoterik","id":2908224,"avatar_url":"https://avatars.githubusercontent.com/u/2908224?v=3","gravatar_id":"","url":"https://api.github.com/users/esoterik","html_url":"https://github.com/esoterik","followers_url":"https://api.github.com/users/esoterik/followers","following_url":"https://api.github.com/users/esoterik/following{/other_user}","gists_url":"https://api.github.com/users/esoterik/gists{/gist_id}","starred_url":"https://api.github.com/users/esoterik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esoterik/subscriptions","organizations_url":"https://api.github.com/users/esoterik/orgs","repos_url":"https://api.github.com/users/esoterik/repos","events_url":"https://api.github.com/users/esoterik/events{/privacy}","received_events_url":"https://api.github.com/users/esoterik/received_events","type":"User","site_admin":false},"body":"resolves #462 ","created_at":"2015-04-06T01:47:28Z","updated_at":"2015-04-07T16:48:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d2a7ff99cff8023cfefc78452b3832cb6895ae7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220/commits","review_comments_url":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220/comments","review_comment_url":"https://api.github.com/repos/YaleSTC/reservations/pulls/comments{/number}","comments_url":"https://api.github.com/repos/YaleSTC/reservations/issues/1220/comments","statuses_url":"https://api.github.com/repos/YaleSTC/reservations/statuses/be1e2abdc8804e3030f7690cfbda43fe62b94e19","head":{"label":"YaleSTC:462_status_overhaul","ref":"462_status_overhaul","sha":"be1e2abdc8804e3030f7690cfbda43fe62b94e19","user":{"login":"YaleSTC","id":106094,"avatar_url":"https://avatars.githubusercontent.com/u/106094?v=3","gravatar_id":"","url":"https://api.github.com/users/YaleSTC","html_url":"https://github.com/YaleSTC","followers_url":"https://api.github.com/users/YaleSTC/followers","following_url":"https://api.github.com/users/YaleSTC/following{/other_user}","gists_url":"https://api.github.com/users/YaleSTC/gists{/gist_id}","starred_url":"https://api.github.com/users/YaleSTC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YaleSTC/subscriptions","organizations_url":"https://api.github.com/users/YaleSTC/orgs","repos_url":"https://api.github.com/users/YaleSTC/repos","events_url":"https://api.github.com/users/YaleSTC/events{/privacy}","received_events_url":"https://api.github.com/users/YaleSTC/received_events","type":"Organization","site_admin":false},"repo":{"id":345280,"name":"reservations","full_name":"YaleSTC/reservations","owner":{"login":"YaleSTC","id":106094,"avatar_url":"https://avatars.githubusercontent.com/u/106094?v=3","gravatar_id":"","url":"https://api.github.com/users/YaleSTC","html_url":"https://github.com/YaleSTC","followers_url":"https://api.github.com/users/YaleSTC/followers","following_url":"https://api.github.com/users/YaleSTC/following{/other_user}","gists_url":"https://api.github.com/users/YaleSTC/gists{/gist_id}","starred_url":"https://api.github.com/users/YaleSTC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YaleSTC/subscriptions","organizations_url":"https://api.github.com/users/YaleSTC/orgs","repos_url":"https://api.github.com/users/YaleSTC/repos","events_url":"https://api.github.com/users/YaleSTC/events{/privacy}","received_events_url":"https://api.github.com/users/YaleSTC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/YaleSTC/reservations","description":"Manage equipment loans & reservations. Who can borrow what, for how long?","fork":false,"url":"https://api.github.com/repos/YaleSTC/reservations","forks_url":"https://api.github.com/repos/YaleSTC/reservations/forks","keys_url":"https://api.github.com/repos/YaleSTC/reservations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YaleSTC/reservations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YaleSTC/reservations/teams","hooks_url":"https://api.github.com/repos/YaleSTC/reservations/hooks","issue_events_url":"https://api.github.com/repos/YaleSTC/reservations/issues/events{/number}","events_url":"https://api.github.com/repos/YaleSTC/reservations/events","assignees_url":"https://api.github.com/repos/YaleSTC/reservations/assignees{/user}","branches_url":"https://api.github.com/repos/YaleSTC/reservations/branches{/branch}","tags_url":"https://api.github.com/repos/YaleSTC/reservations/tags","blobs_url":"https://api.github.com/repos/YaleSTC/reservations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YaleSTC/reservations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YaleSTC/reservations/git/refs{/sha}","trees_url":"https://api.github.com/repos/YaleSTC/reservations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YaleSTC/reservations/statuses/{sha}","languages_url":"https://api.github.com/repos/YaleSTC/reservations/languages","stargazers_url":"https://api.github.com/repos/YaleSTC/reservations/stargazers","contributors_url":"https://api.github.com/repos/YaleSTC/reservations/contributors","subscribers_url":"https://api.github.com/repos/YaleSTC/reservations/subscribers","subscription_url":"https://api.github.com/repos/YaleSTC/reservations/subscription","commits_url":"https://api.github.com/repos/YaleSTC/reservations/commits{/sha}","git_commits_url":"https://api.github.com/repos/YaleSTC/reservations/git/commits{/sha}","comments_url":"https://api.github.com/repos/YaleSTC/reservations/comments{/number}","issue_comment_url":"https://api.github.com/repos/YaleSTC/reservations/issues/comments{/number}","contents_url":"https://api.github.com/repos/YaleSTC/reservations/contents/{+path}","compare_url":"https://api.github.com/repos/YaleSTC/reservations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YaleSTC/reservations/merges","archive_url":"https://api.github.com/repos/YaleSTC/reservations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YaleSTC/reservations/downloads","issues_url":"https://api.github.com/repos/YaleSTC/reservations/issues{/number}","pulls_url":"https://api.github.com/repos/YaleSTC/reservations/pulls{/number}","milestones_url":"https://api.github.com/repos/YaleSTC/reservations/milestones{/number}","notifications_url":"https://api.github.com/repos/YaleSTC/reservations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YaleSTC/reservations/labels{/name}","releases_url":"https://api.github.com/repos/YaleSTC/reservations/releases{/id}","created_at":"2009-10-21T21:08:00Z","updated_at":"2015-04-07T05:10:59Z","pushed_at":"2015-04-07T05:12:21Z","git_url":"git://github.com/YaleSTC/reservations.git","ssh_url":"git@github.com:YaleSTC/reservations.git","clone_url":"https://github.com/YaleSTC/reservations.git","svn_url":"https://github.com/YaleSTC/reservations","homepage":"yalestc.github.io/reservations","size":58475,"stargazers_count":41,"watchers_count":41,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":127,"forks":17,"open_issues":127,"watchers":41,"default_branch":"master"}},"base":{"label":"YaleSTC:master","ref":"master","sha":"43e48d7a384984ad0b2bb92eb1cba4725c0b3d8d","user":{"login":"YaleSTC","id":106094,"avatar_url":"https://avatars.githubusercontent.com/u/106094?v=3","gravatar_id":"","url":"https://api.github.com/users/YaleSTC","html_url":"https://github.com/YaleSTC","followers_url":"https://api.github.com/users/YaleSTC/followers","following_url":"https://api.github.com/users/YaleSTC/following{/other_user}","gists_url":"https://api.github.com/users/YaleSTC/gists{/gist_id}","starred_url":"https://api.github.com/users/YaleSTC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YaleSTC/subscriptions","organizations_url":"https://api.github.com/users/YaleSTC/orgs","repos_url":"https://api.github.com/users/YaleSTC/repos","events_url":"https://api.github.com/users/YaleSTC/events{/privacy}","received_events_url":"https://api.github.com/users/YaleSTC/received_events","type":"Organization","site_admin":false},"repo":{"id":345280,"name":"reservations","full_name":"YaleSTC/reservations","owner":{"login":"YaleSTC","id":106094,"avatar_url":"https://avatars.githubusercontent.com/u/106094?v=3","gravatar_id":"","url":"https://api.github.com/users/YaleSTC","html_url":"https://github.com/YaleSTC","followers_url":"https://api.github.com/users/YaleSTC/followers","following_url":"https://api.github.com/users/YaleSTC/following{/other_user}","gists_url":"https://api.github.com/users/YaleSTC/gists{/gist_id}","starred_url":"https://api.github.com/users/YaleSTC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YaleSTC/subscriptions","organizations_url":"https://api.github.com/users/YaleSTC/orgs","repos_url":"https://api.github.com/users/YaleSTC/repos","events_url":"https://api.github.com/users/YaleSTC/events{/privacy}","received_events_url":"https://api.github.com/users/YaleSTC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/YaleSTC/reservations","description":"Manage equipment loans & reservations. Who can borrow what, for how long?","fork":false,"url":"https://api.github.com/repos/YaleSTC/reservations","forks_url":"https://api.github.com/repos/YaleSTC/reservations/forks","keys_url":"https://api.github.com/repos/YaleSTC/reservations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YaleSTC/reservations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YaleSTC/reservations/teams","hooks_url":"https://api.github.com/repos/YaleSTC/reservations/hooks","issue_events_url":"https://api.github.com/repos/YaleSTC/reservations/issues/events{/number}","events_url":"https://api.github.com/repos/YaleSTC/reservations/events","assignees_url":"https://api.github.com/repos/YaleSTC/reservations/assignees{/user}","branches_url":"https://api.github.com/repos/YaleSTC/reservations/branches{/branch}","tags_url":"https://api.github.com/repos/YaleSTC/reservations/tags","blobs_url":"https://api.github.com/repos/YaleSTC/reservations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YaleSTC/reservations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YaleSTC/reservations/git/refs{/sha}","trees_url":"https://api.github.com/repos/YaleSTC/reservations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YaleSTC/reservations/statuses/{sha}","languages_url":"https://api.github.com/repos/YaleSTC/reservations/languages","stargazers_url":"https://api.github.com/repos/YaleSTC/reservations/stargazers","contributors_url":"https://api.github.com/repos/YaleSTC/reservations/contributors","subscribers_url":"https://api.github.com/repos/YaleSTC/reservations/subscribers","subscription_url":"https://api.github.com/repos/YaleSTC/reservations/subscription","commits_url":"https://api.github.com/repos/YaleSTC/reservations/commits{/sha}","git_commits_url":"https://api.github.com/repos/YaleSTC/reservations/git/commits{/sha}","comments_url":"https://api.github.com/repos/YaleSTC/reservations/comments{/number}","issue_comment_url":"https://api.github.com/repos/YaleSTC/reservations/issues/comments{/number}","contents_url":"https://api.github.com/repos/YaleSTC/reservations/contents/{+path}","compare_url":"https://api.github.com/repos/YaleSTC/reservations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YaleSTC/reservations/merges","archive_url":"https://api.github.com/repos/YaleSTC/reservations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YaleSTC/reservations/downloads","issues_url":"https://api.github.com/repos/YaleSTC/reservations/issues{/number}","pulls_url":"https://api.github.com/repos/YaleSTC/reservations/pulls{/number}","milestones_url":"https://api.github.com/repos/YaleSTC/reservations/milestones{/number}","notifications_url":"https://api.github.com/repos/YaleSTC/reservations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YaleSTC/reservations/labels{/name}","releases_url":"https://api.github.com/repos/YaleSTC/reservations/releases{/id}","created_at":"2009-10-21T21:08:00Z","updated_at":"2015-04-07T05:10:59Z","pushed_at":"2015-04-07T05:12:21Z","git_url":"git://github.com/YaleSTC/reservations.git","ssh_url":"git@github.com:YaleSTC/reservations.git","clone_url":"https://github.com/YaleSTC/reservations.git","svn_url":"https://github.com/YaleSTC/reservations","homepage":"yalestc.github.io/reservations","size":58475,"stargazers_count":41,"watchers_count":41,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":127,"forks":17,"open_issues":127,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220"},"html":{"href":"https://github.com/YaleSTC/reservations/pull/1220"},"issue":{"href":"https://api.github.com/repos/YaleSTC/reservations/issues/1220"},"comments":{"href":"https://api.github.com/repos/YaleSTC/reservations/issues/1220/comments"},"review_comments":{"href":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220/comments"},"review_comment":{"href":"https://api.github.com/repos/YaleSTC/reservations/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/YaleSTC/reservations/pulls/1220/commits"},"statuses":{"href":"https://api.github.com/repos/YaleSTC/reservations/statuses/be1e2abdc8804e3030f7690cfbda43fe62b94e19"}}}}