{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/comments/47118975","id":47118975,"diff_hunk":"@@ -35,6 +35,10 @@ def last_bookable_date(today = Time.zone.today)\n     today + booking_window\n   end\n \n+  def bookable_date?(requested_date = Time.zone.today)\n+    available_slots.each(&:iso8601).include?(requested_date)","path":"app/models/prison.rb","position":5,"original_position":5,"commit_id":"0cd8f630046787c34c3f5fed658f2ee7770a02f9","original_commit_id":"0cd8f630046787c34c3f5fed658f2ee7770a02f9","user":{"login":"threedaymonk","id":17347,"avatar_url":"https://avatars.githubusercontent.com/u/17347?v=3","gravatar_id":"","url":"https://api.github.com/users/threedaymonk","html_url":"https://github.com/threedaymonk","followers_url":"https://api.github.com/users/threedaymonk/followers","following_url":"https://api.github.com/users/threedaymonk/following{/other_user}","gists_url":"https://api.github.com/users/threedaymonk/gists{/gist_id}","starred_url":"https://api.github.com/users/threedaymonk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/threedaymonk/subscriptions","organizations_url":"https://api.github.com/users/threedaymonk/orgs","repos_url":"https://api.github.com/users/threedaymonk/repos","events_url":"https://api.github.com/users/threedaymonk/events{/privacy}","received_events_url":"https://api.github.com/users/threedaymonk/received_events","type":"User","site_admin":false},"body":"I think a more expressive implementation might be to add a `to_date` method to `ConcreteSlot` and:\r\n\r\n```ruby\r\navailable_slots.any? { |slot| slot.to_date == requested_date }\r\n```\r\n\r\nOr perhaps an `on?` method:\r\n\r\n```ruby\r\navailable_slots.any? { |s| s.on?(requested_date) }\r\n```","created_at":"2015-12-09T16:59:57Z","updated_at":"2015-12-09T16:59:57Z","html_url":"https://github.com/ministryofjustice/prison-visits-2/pull/45#discussion_r47118975","pull_request_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/comments/47118975"},"html":{"href":"https://github.com/ministryofjustice/prison-visits-2/pull/45#discussion_r47118975"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45","id":52848831,"html_url":"https://github.com/ministryofjustice/prison-visits-2/pull/45","diff_url":"https://github.com/ministryofjustice/prison-visits-2/pull/45.diff","patch_url":"https://github.com/ministryofjustice/prison-visits-2/pull/45.patch","issue_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/45","number":45,"state":"open","locked":false,"title":"Enable datepicker","user":{"login":"tatyree","id":20921,"avatar_url":"https://avatars.githubusercontent.com/u/20921?v=3","gravatar_id":"","url":"https://api.github.com/users/tatyree","html_url":"https://github.com/tatyree","followers_url":"https://api.github.com/users/tatyree/followers","following_url":"https://api.github.com/users/tatyree/following{/other_user}","gists_url":"https://api.github.com/users/tatyree/gists{/gist_id}","starred_url":"https://api.github.com/users/tatyree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatyree/subscriptions","organizations_url":"https://api.github.com/users/tatyree/orgs","repos_url":"https://api.github.com/users/tatyree/repos","events_url":"https://api.github.com/users/tatyree/events{/privacy}","received_events_url":"https://api.github.com/users/tatyree/received_events","type":"User","site_admin":false},"body":"The smoke tests depend on the MoJ JS datepicker.  This is a port/adaption/simplification based on what is in the old app and what @threedaymonk has already done for the prison staff. \r\n\r\nI was doing it in the `smoke-tests` branch, but it is of sufficiently high complexity that it seemed sensible to break it out into its own branch. ","created_at":"2015-12-07T14:12:39Z","updated_at":"2015-12-09T16:59:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93e4afa92d79a0e344853cffa10e2f1de71f3387","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/45/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/statuses/0cd8f630046787c34c3f5fed658f2ee7770a02f9","head":{"label":"ministryofjustice:enable-datepicker","ref":"enable-datepicker","sha":"0cd8f630046787c34c3f5fed658f2ee7770a02f9","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":44737633,"name":"prison-visits-2","full_name":"ministryofjustice/prison-visits-2","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/prison-visits-2","description":"A full ground-up rewrite","fork":false,"url":"https://api.github.com/repos/ministryofjustice/prison-visits-2","forks_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/forks","keys_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/events","assignees_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/merges","archive_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/releases{/id}","created_at":"2015-10-22T10:12:32Z","updated_at":"2015-12-08T16:04:44Z","pushed_at":"2015-12-09T16:46:55Z","git_url":"git://github.com/ministryofjustice/prison-visits-2.git","ssh_url":"git@github.com:ministryofjustice/prison-visits-2.git","clone_url":"https://github.com/ministryofjustice/prison-visits-2.git","svn_url":"https://github.com/ministryofjustice/prison-visits-2","homepage":"","size":955,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"68d741222eb3b90f49ca793e64b5ae1e6c47c238","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":44737633,"name":"prison-visits-2","full_name":"ministryofjustice/prison-visits-2","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/prison-visits-2","description":"A full ground-up rewrite","fork":false,"url":"https://api.github.com/repos/ministryofjustice/prison-visits-2","forks_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/forks","keys_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/events","assignees_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/merges","archive_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/prison-visits-2/releases{/id}","created_at":"2015-10-22T10:12:32Z","updated_at":"2015-12-08T16:04:44Z","pushed_at":"2015-12-09T16:46:55Z","git_url":"git://github.com/ministryofjustice/prison-visits-2.git","ssh_url":"git@github.com:ministryofjustice/prison-visits-2.git","clone_url":"https://github.com/ministryofjustice/prison-visits-2.git","svn_url":"https://github.com/ministryofjustice/prison-visits-2","homepage":"","size":955,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45"},"html":{"href":"https://github.com/ministryofjustice/prison-visits-2/pull/45"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/45"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/prison-visits-2/statuses/0cd8f630046787c34c3f5fed658f2ee7770a02f9"}}}}