{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/83097008","pull_request_review_id":3960609,"id":83097008,"diff_hunk":"@@ -0,0 +1,7 @@\n+class OpeningLedgerEntriesForStoreCredits < ActiveRecord::Migration[5.0]\n+  def change\n+    Spree::StoreCredit.find_each do |store_credit|\n+      Spree::StoreCreditLedgerEntry.generate_opening_ledger_entry_for(store_credit)","path":"core/db/migrate/20161012151358_opening_ledger_entries_for_store_credits.rb","position":4,"original_position":4,"commit_id":"f6eee58780452c7da9b83016d30c58fd85069967","original_commit_id":"9461e34534d5d3630f6803180bf3f48f8324b115","user":{"login":"peterberkenbosch","id":4252,"avatar_url":"https://avatars.githubusercontent.com/u/4252?v=3","gravatar_id":"","url":"https://api.github.com/users/peterberkenbosch","html_url":"https://github.com/peterberkenbosch","followers_url":"https://api.github.com/users/peterberkenbosch/followers","following_url":"https://api.github.com/users/peterberkenbosch/following{/other_user}","gists_url":"https://api.github.com/users/peterberkenbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/peterberkenbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterberkenbosch/subscriptions","organizations_url":"https://api.github.com/users/peterberkenbosch/orgs","repos_url":"https://api.github.com/users/peterberkenbosch/repos","events_url":"https://api.github.com/users/peterberkenbosch/events{/privacy}","received_events_url":"https://api.github.com/users/peterberkenbosch/received_events","type":"User","site_admin":false},"body":"Yes, wanted to have something that was easily testable though. Looking into options here.","created_at":"2016-10-12T20:57:42Z","updated_at":"2016-10-12T20:57:42Z","html_url":"https://github.com/solidusio/solidus/pull/1513#discussion_r83097008","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/1513","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/83097008"},"html":{"href":"https://github.com/solidusio/solidus/pull/1513#discussion_r83097008"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1513"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/1513","id":88743468,"html_url":"https://github.com/solidusio/solidus/pull/1513","diff_url":"https://github.com/solidusio/solidus/pull/1513.diff","patch_url":"https://github.com/solidusio/solidus/pull/1513.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/1513","number":1513,"state":"open","locked":false,"title":"Ledger events for store credits.","user":{"login":"peterberkenbosch","id":4252,"avatar_url":"https://avatars.githubusercontent.com/u/4252?v=3","gravatar_id":"","url":"https://api.github.com/users/peterberkenbosch","html_url":"https://github.com/peterberkenbosch","followers_url":"https://api.github.com/users/peterberkenbosch/followers","following_url":"https://api.github.com/users/peterberkenbosch/following{/other_user}","gists_url":"https://api.github.com/users/peterberkenbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/peterberkenbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterberkenbosch/subscriptions","organizations_url":"https://api.github.com/users/peterberkenbosch/orgs","repos_url":"https://api.github.com/users/peterberkenbosch/repos","events_url":"https://api.github.com/users/peterberkenbosch/events{/privacy}","received_events_url":"https://api.github.com/users/peterberkenbosch/received_events","type":"User","site_admin":false},"body":"The `store_credit_event` is recording an audit trail to provide some insight in the lifeline of a `store_credit`. However, it would be nice to have an actual ledger for the store credits, that will focus only on the events that will have a financial consequence to the store owner.\r\n\r\nThis PR introduces the `store_credit_legder_event` that will provide historically consistent reporting of store credit liabilities. \r\n\r\n","created_at":"2016-10-10T22:44:17Z","updated_at":"2016-10-12T20:57:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4772691831589ac6b4404f9b1a586463b9355523","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/1513/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/1513/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/1513/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/f6eee58780452c7da9b83016d30c58fd85069967","head":{"label":"peterberkenbosch:store-credits-ledger-events","ref":"store-credits-ledger-events","sha":"f6eee58780452c7da9b83016d30c58fd85069967","user":{"login":"peterberkenbosch","id":4252,"avatar_url":"https://avatars.githubusercontent.com/u/4252?v=3","gravatar_id":"","url":"https://api.github.com/users/peterberkenbosch","html_url":"https://github.com/peterberkenbosch","followers_url":"https://api.github.com/users/peterberkenbosch/followers","following_url":"https://api.github.com/users/peterberkenbosch/following{/other_user}","gists_url":"https://api.github.com/users/peterberkenbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/peterberkenbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterberkenbosch/subscriptions","organizations_url":"https://api.github.com/users/peterberkenbosch/orgs","repos_url":"https://api.github.com/users/peterberkenbosch/repos","events_url":"https://api.github.com/users/peterberkenbosch/events{/privacy}","received_events_url":"https://api.github.com/users/peterberkenbosch/received_events","type":"User","site_admin":false},"repo":{"id":38507527,"name":"solidus","full_name":"peterberkenbosch/solidus","owner":{"login":"peterberkenbosch","id":4252,"avatar_url":"https://avatars.githubusercontent.com/u/4252?v=3","gravatar_id":"","url":"https://api.github.com/users/peterberkenbosch","html_url":"https://github.com/peterberkenbosch","followers_url":"https://api.github.com/users/peterberkenbosch/followers","following_url":"https://api.github.com/users/peterberkenbosch/following{/other_user}","gists_url":"https://api.github.com/users/peterberkenbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/peterberkenbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterberkenbosch/subscriptions","organizations_url":"https://api.github.com/users/peterberkenbosch/orgs","repos_url":"https://api.github.com/users/peterberkenbosch/repos","events_url":"https://api.github.com/users/peterberkenbosch/events{/privacy}","received_events_url":"https://api.github.com/users/peterberkenbosch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peterberkenbosch/solidus","description":"Solidus e-commerce system","fork":true,"url":"https://api.github.com/repos/peterberkenbosch/solidus","forks_url":"https://api.github.com/repos/peterberkenbosch/solidus/forks","keys_url":"https://api.github.com/repos/peterberkenbosch/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peterberkenbosch/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peterberkenbosch/solidus/teams","hooks_url":"https://api.github.com/repos/peterberkenbosch/solidus/hooks","issue_events_url":"https://api.github.com/repos/peterberkenbosch/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/peterberkenbosch/solidus/events","assignees_url":"https://api.github.com/repos/peterberkenbosch/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/peterberkenbosch/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/peterberkenbosch/solidus/tags","blobs_url":"https://api.github.com/repos/peterberkenbosch/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peterberkenbosch/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peterberkenbosch/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/peterberkenbosch/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peterberkenbosch/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/peterberkenbosch/solidus/languages","stargazers_url":"https://api.github.com/repos/peterberkenbosch/solidus/stargazers","contributors_url":"https://api.github.com/repos/peterberkenbosch/solidus/contributors","subscribers_url":"https://api.github.com/repos/peterberkenbosch/solidus/subscribers","subscription_url":"https://api.github.com/repos/peterberkenbosch/solidus/subscription","commits_url":"https://api.github.com/repos/peterberkenbosch/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/peterberkenbosch/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/peterberkenbosch/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/peterberkenbosch/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/peterberkenbosch/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/peterberkenbosch/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peterberkenbosch/solidus/merges","archive_url":"https://api.github.com/repos/peterberkenbosch/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peterberkenbosch/solidus/downloads","issues_url":"https://api.github.com/repos/peterberkenbosch/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/peterberkenbosch/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/peterberkenbosch/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/peterberkenbosch/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peterberkenbosch/solidus/labels{/name}","releases_url":"https://api.github.com/repos/peterberkenbosch/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/peterberkenbosch/solidus/deployments","created_at":"2015-07-03T19:24:26Z","updated_at":"2016-02-25T15:21:23Z","pushed_at":"2016-10-12T20:46:46Z","git_url":"git://github.com/peterberkenbosch/solidus.git","ssh_url":"git@github.com:peterberkenbosch/solidus.git","clone_url":"https://github.com/peterberkenbosch/solidus.git","svn_url":"https://github.com/peterberkenbosch/solidus","homepage":"","size":68443,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"solidusio:master","ref":"master","sha":"9cbc08ab276d4f564d5b40860cd3f1844ab62b3b","user":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"repo":{"id":30985840,"name":"solidus","full_name":"solidusio/solidus","owner":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solidusio/solidus","description":"Solidus, Rails eCommerce System","fork":false,"url":"https://api.github.com/repos/solidusio/solidus","forks_url":"https://api.github.com/repos/solidusio/solidus/forks","keys_url":"https://api.github.com/repos/solidusio/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solidusio/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solidusio/solidus/teams","hooks_url":"https://api.github.com/repos/solidusio/solidus/hooks","issue_events_url":"https://api.github.com/repos/solidusio/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/solidusio/solidus/events","assignees_url":"https://api.github.com/repos/solidusio/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/solidusio/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/solidusio/solidus/tags","blobs_url":"https://api.github.com/repos/solidusio/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solidusio/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solidusio/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/solidusio/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/solidusio/solidus/languages","stargazers_url":"https://api.github.com/repos/solidusio/solidus/stargazers","contributors_url":"https://api.github.com/repos/solidusio/solidus/contributors","subscribers_url":"https://api.github.com/repos/solidusio/solidus/subscribers","subscription_url":"https://api.github.com/repos/solidusio/solidus/subscription","commits_url":"https://api.github.com/repos/solidusio/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/solidusio/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/solidusio/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/solidusio/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/solidusio/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/solidusio/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solidusio/solidus/merges","archive_url":"https://api.github.com/repos/solidusio/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solidusio/solidus/downloads","issues_url":"https://api.github.com/repos/solidusio/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/solidusio/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/solidusio/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/solidusio/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solidusio/solidus/labels{/name}","releases_url":"https://api.github.com/repos/solidusio/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/solidusio/solidus/deployments","created_at":"2015-02-18T20:41:58Z","updated_at":"2016-10-12T20:09:20Z","pushed_at":"2016-10-12T20:50:21Z","git_url":"git://github.com/solidusio/solidus.git","ssh_url":"git@github.com:solidusio/solidus.git","clone_url":"https://github.com/solidusio/solidus.git","svn_url":"https://github.com/solidusio/solidus","homepage":"https://solidus.io/","size":71266,"stargazers_count":1109,"watchers_count":1109,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":339,"mirror_url":null,"open_issues_count":176,"forks":339,"open_issues":176,"watchers":1109,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1513"},"html":{"href":"https://github.com/solidusio/solidus/pull/1513"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1513"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1513/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1513/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1513/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/f6eee58780452c7da9b83016d30c58fd85069967"}}}}
{"actor":{"display_login":"peterberkenbosch"}}