{"action":"created","comment":{"url":"https://api.github.com/repos/ndlib/honeycomb/pulls/comments/35347840","id":35347840,"diff_hunk":"@@ -3,84 +3,22 @@\n describe DateValidator do\n   let(:item) { Item.new }\n \n-  context \"with valid date\" do\n-    it \"does not require a date string to be submitted\" do\n-      item.date_created = nil\n-      expect(item).to have(0).errors_on(:date_created)\n-    end\n-\n-    it \"allows 1-4 digit years\" do\n-      item.date_created = \"1\"\n-      expect(item).to have(0).errors_on(:date_created)\n-    end\n-\n-    it \"allows 1-2 digit months\" do\n-      item.date_created = \"1-06\"\n-      expect(item).to have(0).errors_on(:date_created)\n-    end\n-\n-    it \"allows 1-2 digit days\" do\n-      item.date_created = \"1-06-30\"\n-      expect(item).to have(0).errors_on(:date_created)\n-    end\n-\n-    it \"allows BC dates\" do\n-      item.date_created = \"-01-06\"\n-      expect(item).to have(0).errors_on(:date_created)\n-    end\n-\n-    it \"allows dates with only a year\" do\n-      item.date_created = \"-01\"\n-      expect(item).to have(0).errors_on(:date_created)\n-    end\n-\n-    it \"allows dates with only a month and a year\" do\n-      item.date_created = \"1-06\"\n-      expect(item).to have(0).errors_on(:date_created)\n-    end\n+  it \"passes the errors from metadata date to determine validity\" do\n+    expect_any_instance_of(MetadataDate).to receive(:valid?).twice.and_return(true)\n+    i = Item.new(date_created: { year: '2010' })","path":"spec/validators/date_validator_spec.rb","position":41,"original_position":41,"commit_id":"ebf35d7bcc97705b7864eb461c328a7ce6896223","original_commit_id":"ebf35d7bcc97705b7864eb461c328a7ce6896223","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-07-23T17:29:23Z","updated_at":"2015-07-23T17:29:23Z","html_url":"https://github.com/ndlib/honeycomb/pull/179#discussion_r35347840","pull_request_url":"https://api.github.com/repos/ndlib/honeycomb/pulls/179","_links":{"self":{"href":"https://api.github.com/repos/ndlib/honeycomb/pulls/comments/35347840"},"html":{"href":"https://github.com/ndlib/honeycomb/pull/179#discussion_r35347840"},"pull_request":{"href":"https://api.github.com/repos/ndlib/honeycomb/pulls/179"}}},"pull_request":{"url":"https://api.github.com/repos/ndlib/honeycomb/pulls/179","id":40696562,"html_url":"https://github.com/ndlib/honeycomb/pull/179","diff_url":"https://github.com/ndlib/honeycomb/pull/179.diff","patch_url":"https://github.com/ndlib/honeycomb/pull/179.patch","issue_url":"https://api.github.com/repos/ndlib/honeycomb/issues/179","number":179,"state":"open","locked":false,"title":"Immediate date fix","user":{"login":"jonhartzler","id":124502,"avatar_url":"https://avatars.githubusercontent.com/u/124502?v=3","gravatar_id":"","url":"https://api.github.com/users/jonhartzler","html_url":"https://github.com/jonhartzler","followers_url":"https://api.github.com/users/jonhartzler/followers","following_url":"https://api.github.com/users/jonhartzler/following{/other_user}","gists_url":"https://api.github.com/users/jonhartzler/gists{/gist_id}","starred_url":"https://api.github.com/users/jonhartzler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonhartzler/subscriptions","organizations_url":"https://api.github.com/users/jonhartzler/orgs","repos_url":"https://api.github.com/users/jonhartzler/repos","events_url":"https://api.github.com/users/jonhartzler/events{/privacy}","received_events_url":"https://api.github.com/users/jonhartzler/received_events","type":"User","site_admin":false},"body":"Why:  The code for validating dates and sending api response was both using the metadata_date model.  That model was incompatible with both operations in the case when data in the form was invalid.  This was because the we were relying on the failure of the metadata date to convert itself to a ruby date to raise exceptions.  This set of changes refactors that.  I also determined that the old storage format for dates caused a lot of extra code to be written so I refactored that as.\r\n\r\nWhat:  I updated the way that date data is stored see: https://github.com/ndlib/honeycomb/wiki/Meta-Data-Storage  and how the date object will be sent in the api see: https://github.com/ndlib/honeycomb/wiki/Meta-Data-Api.   I also adjusted where the validations are happening and to stop relying on the metadata date conversion.  In addition I refactored the code so that the conversion algorithms got their own classes.  ","created_at":"2015-07-23T17:26:18Z","updated_at":"2015-07-23T17:29:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b72446cc6e22179bee712af67ce9c0b77447393","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ndlib/honeycomb/pulls/179/commits","review_comments_url":"https://api.github.com/repos/ndlib/honeycomb/pulls/179/comments","review_comment_url":"https://api.github.com/repos/ndlib/honeycomb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ndlib/honeycomb/issues/179/comments","statuses_url":"https://api.github.com/repos/ndlib/honeycomb/statuses/ebf35d7bcc97705b7864eb461c328a7ce6896223","head":{"label":"ndlib:immediate-date-fix","ref":"immediate-date-fix","sha":"ebf35d7bcc97705b7864eb461c328a7ce6896223","user":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":25221636,"name":"honeycomb","full_name":"ndlib/honeycomb","owner":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ndlib/honeycomb","description":"Honeycomb provides basic collection and item administration, as well as serialization of your collections so they can be used by external applications.","fork":false,"url":"https://api.github.com/repos/ndlib/honeycomb","forks_url":"https://api.github.com/repos/ndlib/honeycomb/forks","keys_url":"https://api.github.com/repos/ndlib/honeycomb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/honeycomb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/honeycomb/teams","hooks_url":"https://api.github.com/repos/ndlib/honeycomb/hooks","issue_events_url":"https://api.github.com/repos/ndlib/honeycomb/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/honeycomb/events","assignees_url":"https://api.github.com/repos/ndlib/honeycomb/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/honeycomb/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/honeycomb/tags","blobs_url":"https://api.github.com/repos/ndlib/honeycomb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/honeycomb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/honeycomb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/honeycomb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/honeycomb/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/honeycomb/languages","stargazers_url":"https://api.github.com/repos/ndlib/honeycomb/stargazers","contributors_url":"https://api.github.com/repos/ndlib/honeycomb/contributors","subscribers_url":"https://api.github.com/repos/ndlib/honeycomb/subscribers","subscription_url":"https://api.github.com/repos/ndlib/honeycomb/subscription","commits_url":"https://api.github.com/repos/ndlib/honeycomb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/honeycomb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/honeycomb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/honeycomb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/honeycomb/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/honeycomb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/honeycomb/merges","archive_url":"https://api.github.com/repos/ndlib/honeycomb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/honeycomb/downloads","issues_url":"https://api.github.com/repos/ndlib/honeycomb/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/honeycomb/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/honeycomb/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/honeycomb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/honeycomb/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/honeycomb/releases{/id}","created_at":"2014-10-14T18:55:34Z","updated_at":"2015-05-08T12:21:27Z","pushed_at":"2015-07-23T17:29:19Z","git_url":"git://github.com/ndlib/honeycomb.git","ssh_url":"git@github.com:ndlib/honeycomb.git","clone_url":"https://github.com/ndlib/honeycomb.git","svn_url":"https://github.com/ndlib/honeycomb","homepage":"","size":93232,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"ndlib:master","ref":"master","sha":"ce7f4ce572d632a70fac9b5e30c6f1df08c24b96","user":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":25221636,"name":"honeycomb","full_name":"ndlib/honeycomb","owner":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ndlib/honeycomb","description":"Honeycomb provides basic collection and item administration, as well as serialization of your collections so they can be used by external applications.","fork":false,"url":"https://api.github.com/repos/ndlib/honeycomb","forks_url":"https://api.github.com/repos/ndlib/honeycomb/forks","keys_url":"https://api.github.com/repos/ndlib/honeycomb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/honeycomb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/honeycomb/teams","hooks_url":"https://api.github.com/repos/ndlib/honeycomb/hooks","issue_events_url":"https://api.github.com/repos/ndlib/honeycomb/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/honeycomb/events","assignees_url":"https://api.github.com/repos/ndlib/honeycomb/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/honeycomb/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/honeycomb/tags","blobs_url":"https://api.github.com/repos/ndlib/honeycomb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/honeycomb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/honeycomb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/honeycomb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/honeycomb/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/honeycomb/languages","stargazers_url":"https://api.github.com/repos/ndlib/honeycomb/stargazers","contributors_url":"https://api.github.com/repos/ndlib/honeycomb/contributors","subscribers_url":"https://api.github.com/repos/ndlib/honeycomb/subscribers","subscription_url":"https://api.github.com/repos/ndlib/honeycomb/subscription","commits_url":"https://api.github.com/repos/ndlib/honeycomb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/honeycomb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/honeycomb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/honeycomb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/honeycomb/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/honeycomb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/honeycomb/merges","archive_url":"https://api.github.com/repos/ndlib/honeycomb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/honeycomb/downloads","issues_url":"https://api.github.com/repos/ndlib/honeycomb/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/honeycomb/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/honeycomb/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/honeycomb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/honeycomb/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/honeycomb/releases{/id}","created_at":"2014-10-14T18:55:34Z","updated_at":"2015-05-08T12:21:27Z","pushed_at":"2015-07-23T17:29:19Z","git_url":"git://github.com/ndlib/honeycomb.git","ssh_url":"git@github.com:ndlib/honeycomb.git","clone_url":"https://github.com/ndlib/honeycomb.git","svn_url":"https://github.com/ndlib/honeycomb","homepage":"","size":93232,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ndlib/honeycomb/pulls/179"},"html":{"href":"https://github.com/ndlib/honeycomb/pull/179"},"issue":{"href":"https://api.github.com/repos/ndlib/honeycomb/issues/179"},"comments":{"href":"https://api.github.com/repos/ndlib/honeycomb/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/ndlib/honeycomb/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/ndlib/honeycomb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ndlib/honeycomb/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/ndlib/honeycomb/statuses/ebf35d7bcc97705b7864eb461c328a7ce6896223"}}}}