{"action":"created","comment":{"url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments/25338672","id":25338672,"diff_hunk":"@@ -2,42 +2,52 @@ module RabbitFeed\n   class Event\n     include ActiveModel::Validations\n \n-    attr_reader :schema, :payload\n-    validates_presence_of :schema, :payload\n+    attr_reader :schema, :payload, :metadata\n+    validates :metadata, presence: true","path":"lib/rabbit_feed/event.rb","position":7,"original_position":7,"commit_id":"01676113cdb9a8c5e507e25c0d61e39f505afcb2","original_commit_id":"01676113cdb9a8c5e507e25c0d61e39f505afcb2","user":{"login":"joshuafleck","id":1008898,"avatar_url":"https://avatars.githubusercontent.com/u/1008898?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuafleck","html_url":"https://github.com/joshuafleck","followers_url":"https://api.github.com/users/joshuafleck/followers","following_url":"https://api.github.com/users/joshuafleck/following{/other_user}","gists_url":"https://api.github.com/users/joshuafleck/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuafleck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuafleck/subscriptions","organizations_url":"https://api.github.com/users/joshuafleck/orgs","repos_url":"https://api.github.com/users/joshuafleck/repos","events_url":"https://api.github.com/users/joshuafleck/events{/privacy}","received_events_url":"https://api.github.com/users/joshuafleck/received_events","type":"User","site_admin":false},"body":"Yes, that is a good point. I don't want to go too overboard with validation though, as I want it to be simple to create sample events for consumer tests. Thoughts?","created_at":"2015-02-25T13:22:13Z","updated_at":"2015-02-25T13:22:13Z","html_url":"https://github.com/simplybusiness/rabbit_feed/pull/17#discussion_r25338672","pull_request_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments/25338672"},"html":{"href":"https://github.com/simplybusiness/rabbit_feed/pull/17#discussion_r25338672"},"pull_request":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17","id":29769620,"html_url":"https://github.com/simplybusiness/rabbit_feed/pull/17","diff_url":"https://github.com/simplybusiness/rabbit_feed/pull/17.diff","patch_url":"https://github.com/simplybusiness/rabbit_feed/pull/17.patch","issue_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/17","number":17,"state":"open","locked":false,"title":"Metadata field on event","user":{"login":"joshuafleck","id":1008898,"avatar_url":"https://avatars.githubusercontent.com/u/1008898?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuafleck","html_url":"https://github.com/joshuafleck","followers_url":"https://api.github.com/users/joshuafleck/followers","following_url":"https://api.github.com/users/joshuafleck/following{/other_user}","gists_url":"https://api.github.com/users/joshuafleck/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuafleck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuafleck/subscriptions","organizations_url":"https://api.github.com/users/joshuafleck/orgs","repos_url":"https://api.github.com/users/joshuafleck/repos","events_url":"https://api.github.com/users/joshuafleck/events{/privacy}","received_events_url":"https://api.github.com/users/joshuafleck/received_events","type":"User","site_admin":false},"body":"@calo81 This PR fixes this issue that you raised: #10, it also fixes #14\r\n\r\nThe practice of pushing the event metadata into the payload was ugly - This has been extracted from the event payload and added as event metadata. This is designed to be backwards compatible with events published before this change.\r\n\r\n@calo81 @dawid-sklodowski @martinbtt @tpaul09, @pvdb Could you please sign off?\r\n","created_at":"2015-02-22T12:12:41Z","updated_at":"2015-02-25T13:22:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d3f2630b0262936058dc34b3d8471959953cfe6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17/commits","review_comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17/comments","review_comment_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/17/comments","statuses_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/01676113cdb9a8c5e507e25c0d61e39f505afcb2","head":{"label":"simplybusiness:metadata_schema","ref":"metadata_schema","sha":"01676113cdb9a8c5e507e25c0d61e39f505afcb2","user":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"repo":{"id":23627952,"name":"rabbit_feed","full_name":"simplybusiness/rabbit_feed","owner":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplybusiness/rabbit_feed","description":"A gem providing asynchronous event publish and subscribe capabilities with RabbitMQ","fork":false,"url":"https://api.github.com/repos/simplybusiness/rabbit_feed","forks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/forks","keys_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/teams","hooks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/hooks","issue_events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/events{/number}","events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/events","assignees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/assignees{/user}","branches_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/branches{/branch}","tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/tags","blobs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/{sha}","languages_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/languages","stargazers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/stargazers","contributors_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contributors","subscribers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscribers","subscription_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscription","commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contents/{+path}","compare_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/merges","archive_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/downloads","issues_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues{/number}","pulls_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls{/number}","milestones_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/milestones{/number}","notifications_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/labels{/name}","releases_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/releases{/id}","created_at":"2014-09-03T16:21:56Z","updated_at":"2015-01-05T17:30:41Z","pushed_at":"2015-02-23T13:55:52Z","git_url":"git://github.com/simplybusiness/rabbit_feed.git","ssh_url":"git@github.com:simplybusiness/rabbit_feed.git","clone_url":"https://github.com/simplybusiness/rabbit_feed.git","svn_url":"https://github.com/simplybusiness/rabbit_feed","homepage":"","size":552,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":4,"default_branch":"master"}},"base":{"label":"simplybusiness:master","ref":"master","sha":"1c69677765c82b99b882a9166f03d927bba1784b","user":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"repo":{"id":23627952,"name":"rabbit_feed","full_name":"simplybusiness/rabbit_feed","owner":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplybusiness/rabbit_feed","description":"A gem providing asynchronous event publish and subscribe capabilities with RabbitMQ","fork":false,"url":"https://api.github.com/repos/simplybusiness/rabbit_feed","forks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/forks","keys_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/teams","hooks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/hooks","issue_events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/events{/number}","events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/events","assignees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/assignees{/user}","branches_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/branches{/branch}","tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/tags","blobs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/{sha}","languages_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/languages","stargazers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/stargazers","contributors_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contributors","subscribers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscribers","subscription_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscription","commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contents/{+path}","compare_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/merges","archive_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/downloads","issues_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues{/number}","pulls_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls{/number}","milestones_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/milestones{/number}","notifications_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/labels{/name}","releases_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/releases{/id}","created_at":"2014-09-03T16:21:56Z","updated_at":"2015-01-05T17:30:41Z","pushed_at":"2015-02-23T13:55:52Z","git_url":"git://github.com/simplybusiness/rabbit_feed.git","ssh_url":"git@github.com:simplybusiness/rabbit_feed.git","clone_url":"https://github.com/simplybusiness/rabbit_feed.git","svn_url":"https://github.com/simplybusiness/rabbit_feed","homepage":"","size":552,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17"},"html":{"href":"https://github.com/simplybusiness/rabbit_feed/pull/17"},"issue":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/17"},"comments":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/01676113cdb9a8c5e507e25c0d61e39f505afcb2"}}}}