{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/59751357","id":59751357,"diff_hunk":"@@ -80,6 +80,7 @@ def readable_inspect\n   #\n   #   date.to_time(:utc)             # => 2007-11-10 00:00:00 UTC\n   def to_time(form = :local)\n+    raise ArgumentError, \"Expected :local or :uts, got #{form}.\" unless [:local, :utc].include?(form)","path":"activesupport/lib/active_support/core_ext/date/conversions.rb","position":4,"original_position":4,"commit_id":"be2dea110b7129bdf2de4d6bfe624e0081a54089","original_commit_id":"be2dea110b7129bdf2de4d6bfe624e0081a54089","user":{"login":"jeremy","id":199,"avatar_url":"https://avatars.githubusercontent.com/u/199?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremy","html_url":"https://github.com/jeremy","followers_url":"https://api.github.com/users/jeremy/followers","following_url":"https://api.github.com/users/jeremy/following{/other_user}","gists_url":"https://api.github.com/users/jeremy/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremy/subscriptions","organizations_url":"https://api.github.com/users/jeremy/orgs","repos_url":"https://api.github.com/users/jeremy/repos","events_url":"https://api.github.com/users/jeremy/events{/privacy}","received_events_url":"https://api.github.com/users/jeremy/received_events","type":"User","site_admin":false},"body":"Can we speed this up (use a case; when) or defer it (rescue NoMethodError and re-raise ArgumentError)?","created_at":"2016-04-14T16:48:59Z","updated_at":"2016-04-14T16:48:59Z","html_url":"https://github.com/rails/rails/pull/24552#discussion_r59751357","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/24552","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/59751357"},"html":{"href":"https://github.com/rails/rails/pull/24552#discussion_r59751357"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/24552"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/24552","id":66509557,"html_url":"https://github.com/rails/rails/pull/24552","diff_url":"https://github.com/rails/rails/pull/24552.diff","patch_url":"https://github.com/rails/rails/pull/24552.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/24552","number":24552,"state":"open","locked":false,"title":"Raise `ArgumentError` when an invalid form is passed to `Date#to_time`","user":{"login":"yui-knk","id":5356517,"avatar_url":"https://avatars.githubusercontent.com/u/5356517?v=3","gravatar_id":"","url":"https://api.github.com/users/yui-knk","html_url":"https://github.com/yui-knk","followers_url":"https://api.github.com/users/yui-knk/followers","following_url":"https://api.github.com/users/yui-knk/following{/other_user}","gists_url":"https://api.github.com/users/yui-knk/gists{/gist_id}","starred_url":"https://api.github.com/users/yui-knk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yui-knk/subscriptions","organizations_url":"https://api.github.com/users/yui-knk/orgs","repos_url":"https://api.github.com/users/yui-knk/repos","events_url":"https://api.github.com/users/yui-knk/events{/privacy}","received_events_url":"https://api.github.com/users/yui-knk/received_events","type":"User","site_admin":false},"body":"Before this commit\r\n`NoMethodError: undefined method `form_name' for Time:Class` is raised\r\nwhen an invalid argument is passed.\r\nIt is better to raise `ArgumentError` and show list of valid arguments\r\nto developers.","created_at":"2016-04-14T15:57:49Z","updated_at":"2016-04-14T16:48:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eec9243ab1526f5c9afbd35d08156c03356ea2ca","assignee":{"login":"pixeltrix","id":6321,"avatar_url":"https://avatars.githubusercontent.com/u/6321?v=3","gravatar_id":"","url":"https://api.github.com/users/pixeltrix","html_url":"https://github.com/pixeltrix","followers_url":"https://api.github.com/users/pixeltrix/followers","following_url":"https://api.github.com/users/pixeltrix/following{/other_user}","gists_url":"https://api.github.com/users/pixeltrix/gists{/gist_id}","starred_url":"https://api.github.com/users/pixeltrix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixeltrix/subscriptions","organizations_url":"https://api.github.com/users/pixeltrix/orgs","repos_url":"https://api.github.com/users/pixeltrix/repos","events_url":"https://api.github.com/users/pixeltrix/events{/privacy}","received_events_url":"https://api.github.com/users/pixeltrix/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/24552/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/24552/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/24552/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/be2dea110b7129bdf2de4d6bfe624e0081a54089","head":{"label":"yui-knk:raise_argument_error","ref":"raise_argument_error","sha":"be2dea110b7129bdf2de4d6bfe624e0081a54089","user":{"login":"yui-knk","id":5356517,"avatar_url":"https://avatars.githubusercontent.com/u/5356517?v=3","gravatar_id":"","url":"https://api.github.com/users/yui-knk","html_url":"https://github.com/yui-knk","followers_url":"https://api.github.com/users/yui-knk/followers","following_url":"https://api.github.com/users/yui-knk/following{/other_user}","gists_url":"https://api.github.com/users/yui-knk/gists{/gist_id}","starred_url":"https://api.github.com/users/yui-knk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yui-knk/subscriptions","organizations_url":"https://api.github.com/users/yui-knk/orgs","repos_url":"https://api.github.com/users/yui-knk/repos","events_url":"https://api.github.com/users/yui-knk/events{/privacy}","received_events_url":"https://api.github.com/users/yui-knk/received_events","type":"User","site_admin":false},"repo":{"id":23390335,"name":"rails","full_name":"yui-knk/rails","owner":{"login":"yui-knk","id":5356517,"avatar_url":"https://avatars.githubusercontent.com/u/5356517?v=3","gravatar_id":"","url":"https://api.github.com/users/yui-knk","html_url":"https://github.com/yui-knk","followers_url":"https://api.github.com/users/yui-knk/followers","following_url":"https://api.github.com/users/yui-knk/following{/other_user}","gists_url":"https://api.github.com/users/yui-knk/gists{/gist_id}","starred_url":"https://api.github.com/users/yui-knk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yui-knk/subscriptions","organizations_url":"https://api.github.com/users/yui-knk/orgs","repos_url":"https://api.github.com/users/yui-knk/repos","events_url":"https://api.github.com/users/yui-knk/events{/privacy}","received_events_url":"https://api.github.com/users/yui-knk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yui-knk/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/yui-knk/rails","forks_url":"https://api.github.com/repos/yui-knk/rails/forks","keys_url":"https://api.github.com/repos/yui-knk/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yui-knk/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yui-knk/rails/teams","hooks_url":"https://api.github.com/repos/yui-knk/rails/hooks","issue_events_url":"https://api.github.com/repos/yui-knk/rails/issues/events{/number}","events_url":"https://api.github.com/repos/yui-knk/rails/events","assignees_url":"https://api.github.com/repos/yui-knk/rails/assignees{/user}","branches_url":"https://api.github.com/repos/yui-knk/rails/branches{/branch}","tags_url":"https://api.github.com/repos/yui-knk/rails/tags","blobs_url":"https://api.github.com/repos/yui-knk/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yui-knk/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yui-knk/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/yui-knk/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yui-knk/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/yui-knk/rails/languages","stargazers_url":"https://api.github.com/repos/yui-knk/rails/stargazers","contributors_url":"https://api.github.com/repos/yui-knk/rails/contributors","subscribers_url":"https://api.github.com/repos/yui-knk/rails/subscribers","subscription_url":"https://api.github.com/repos/yui-knk/rails/subscription","commits_url":"https://api.github.com/repos/yui-knk/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/yui-knk/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/yui-knk/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/yui-knk/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/yui-knk/rails/contents/{+path}","compare_url":"https://api.github.com/repos/yui-knk/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yui-knk/rails/merges","archive_url":"https://api.github.com/repos/yui-knk/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yui-knk/rails/downloads","issues_url":"https://api.github.com/repos/yui-knk/rails/issues{/number}","pulls_url":"https://api.github.com/repos/yui-knk/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/yui-knk/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/yui-knk/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yui-knk/rails/labels{/name}","releases_url":"https://api.github.com/repos/yui-knk/rails/releases{/id}","deployments_url":"https://api.github.com/repos/yui-knk/rails/deployments","created_at":"2014-08-27T13:20:12Z","updated_at":"2016-02-14T03:59:55Z","pushed_at":"2016-04-14T15:57:19Z","git_url":"git://github.com/yui-knk/rails.git","ssh_url":"git@github.com:yui-knk/rails.git","clone_url":"https://github.com/yui-knk/rails.git","svn_url":"https://github.com/yui-knk/rails","homepage":"http://rubyonrails.org","size":129179,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"91798c75bc56fa706c9ed4a8dab6020462463a10","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","deployments_url":"https://api.github.com/repos/rails/rails/deployments","created_at":"2008-04-11T02:19:47Z","updated_at":"2016-04-14T15:18:47Z","pushed_at":"2016-04-14T15:57:49Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":331293,"stargazers_count":30633,"watchers_count":30633,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12439,"mirror_url":null,"open_issues_count":932,"forks":12439,"open_issues":932,"watchers":30633,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/24552"},"html":{"href":"https://github.com/rails/rails/pull/24552"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/24552"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/24552/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/24552/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/24552/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/be2dea110b7129bdf2de4d6bfe624e0081a54089"}}}}