{"action":"created","comment":{"url":"https://api.github.com/repos/spree/spree/pulls/comments/28487161","id":28487161,"diff_hunk":"@@ -16,51 +6,31 @@ class TaxRate < Spree::Base\n     include Spree::AdjustmentSource\n \n     belongs_to :zone, class_name: \"Spree::Zone\", inverse_of: :tax_rates\n-    belongs_to :tax_category, class_name: \"Spree::TaxCategory\", inverse_of: :tax_rates\n+    belongs_to :tax_category,\n+      class_name: \"Spree::TaxCategory\",","path":"core/app/models/spree/tax_rate.rb","position":21,"original_position":21,"commit_id":"87166e5be5ef11f0d176eb910a355ccbb7b2188b","original_commit_id":"87166e5be5ef11f0d176eb910a355ccbb7b2188b","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":"Align the parameters of a method call if they span more than one line.","created_at":"2015-04-16T06:43:54Z","updated_at":"2015-04-16T06:43:54Z","html_url":"https://github.com/spree/spree/pull/6295#discussion_r28487161","pull_request_url":"https://api.github.com/repos/spree/spree/pulls/6295","_links":{"self":{"href":"https://api.github.com/repos/spree/spree/pulls/comments/28487161"},"html":{"href":"https://github.com/spree/spree/pull/6295#discussion_r28487161"},"pull_request":{"href":"https://api.github.com/repos/spree/spree/pulls/6295"}}},"pull_request":{"url":"https://api.github.com/repos/spree/spree/pulls/6295","id":33422951,"html_url":"https://github.com/spree/spree/pull/6295","diff_url":"https://github.com/spree/spree/pull/6295.diff","patch_url":"https://github.com/spree/spree/pull/6295.patch","issue_url":"https://api.github.com/repos/spree/spree/issues/6295","number":6295,"state":"open","locked":false,"title":"Refactor Spree to make MOSS taxation possible","user":{"login":"mamhoff","id":703401,"avatar_url":"https://avatars.githubusercontent.com/u/703401?v=3","gravatar_id":"","url":"https://api.github.com/users/mamhoff","html_url":"https://github.com/mamhoff","followers_url":"https://api.github.com/users/mamhoff/followers","following_url":"https://api.github.com/users/mamhoff/following{/other_user}","gists_url":"https://api.github.com/users/mamhoff/gists{/gist_id}","starred_url":"https://api.github.com/users/mamhoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mamhoff/subscriptions","organizations_url":"https://api.github.com/users/mamhoff/orgs","repos_url":"https://api.github.com/users/mamhoff/repos","events_url":"https://api.github.com/users/mamhoff/events{/privacy}","received_events_url":"https://api.github.com/users/mamhoff/received_events","type":"User","site_admin":false},"body":"1.  Add current_tax_zone helper\r\n\r\n    The `current_tax_zone` is needed for displaying the correct price\r\n    including VAT.\r\n\r\n    In order to cache product prices that depend on the current tax zone, \r\n    we need to add the current tax zone to the cache key for a single or\r\n    multiple products.\r\n\r\n2.  Display correct VAT prices\r\n\r\n  1. Add Spree::Price#price_including_tax_for(zone)\r\n\r\n    This methods returns the correctly calculated gross price\r\n    for any zone that might have VAT. This way we can make sure to\r\n    always include the correct VAT in prices (even if they differ).\r\n\r\n    The method is delegated to Spree::Product and Spree::Variant.\r\n\r\n  2. Amend display_price helper to use current tax zone\r\n\r\n3. Copy price including VAT from Variant\r\n\r\n  This enables us to always have the same price as displayed\r\n  in the order. It also frees us from having to load default VAT\r\n  rates in `tax_rate.rb`.\r\n\r\n  The line item price will only ever be updated after the address\r\n  step in the state machine.\r\n\r\n  One expectation is changed in the back-end, because here the\r\n  price of the line items is updated from the variant, and those are\r\n  different.\r\n\r\n4. Refactor Spree::Zone and Spree::TaxRate\r\n\r\n  When adjusting line items, do not include the default rates\r\n  in the Array of applicable rates. This was only necessary because\r\n  we could not be sure about the price being correct in the first place,\r\n  which is now fixed through ´Spree::Price#price_inlcuding_vat_for(zone)´.\r\n\r\n  As a consequence, I could refactor the stock estimator and fix\r\n  https://github.com/spree/spree/issues/6234.\r\n\r\n5. Add rounding spec to tax_rate_spec.rb\r\n\r\n  This is mainly for posterity: I got stuck in rounding hell once, and\r\n  this test should ensure no-one else will have to.\r\n\r\n6. Fix reimbursement expectations\r\n\r\n  The reimbursement spec expected negative adjustments for included tax,\r\n  which aren't necessary anymore - if your local tax zone does not include\r\n  the default VAT zone's VAT, the price is adjusted accordingly\r\n  beforehand.\r\n\r\n7. Add test for MOSS taxes\r\n\r\n  This is an elaborate almost-integration-test for a particular setup\r\n  proving that it actually *is* possible now to configure Spree for MOSS.","created_at":"2015-04-16T06:43:31Z","updated_at":"2015-04-16T06:43:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56c9d6571e8dd5680827f9e2733d4f3d25d5719b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spree/spree/pulls/6295/commits","review_comments_url":"https://api.github.com/repos/spree/spree/pulls/6295/comments","review_comment_url":"https://api.github.com/repos/spree/spree/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spree/spree/issues/6295/comments","statuses_url":"https://api.github.com/repos/spree/spree/statuses/87166e5be5ef11f0d176eb910a355ccbb7b2188b","head":{"label":"magiclabs:refactor-tax-on-master","ref":"refactor-tax-on-master","sha":"87166e5be5ef11f0d176eb910a355ccbb7b2188b","user":{"login":"magiclabs","id":714995,"avatar_url":"https://avatars.githubusercontent.com/u/714995?v=3","gravatar_id":"","url":"https://api.github.com/users/magiclabs","html_url":"https://github.com/magiclabs","followers_url":"https://api.github.com/users/magiclabs/followers","following_url":"https://api.github.com/users/magiclabs/following{/other_user}","gists_url":"https://api.github.com/users/magiclabs/gists{/gist_id}","starred_url":"https://api.github.com/users/magiclabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magiclabs/subscriptions","organizations_url":"https://api.github.com/users/magiclabs/orgs","repos_url":"https://api.github.com/users/magiclabs/repos","events_url":"https://api.github.com/users/magiclabs/events{/privacy}","received_events_url":"https://api.github.com/users/magiclabs/received_events","type":"Organization","site_admin":false},"repo":{"id":1933829,"name":"spree","full_name":"magiclabs/spree","owner":{"login":"magiclabs","id":714995,"avatar_url":"https://avatars.githubusercontent.com/u/714995?v=3","gravatar_id":"","url":"https://api.github.com/users/magiclabs","html_url":"https://github.com/magiclabs","followers_url":"https://api.github.com/users/magiclabs/followers","following_url":"https://api.github.com/users/magiclabs/following{/other_user}","gists_url":"https://api.github.com/users/magiclabs/gists{/gist_id}","starred_url":"https://api.github.com/users/magiclabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magiclabs/subscriptions","organizations_url":"https://api.github.com/users/magiclabs/orgs","repos_url":"https://api.github.com/users/magiclabs/repos","events_url":"https://api.github.com/users/magiclabs/events{/privacy}","received_events_url":"https://api.github.com/users/magiclabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magiclabs/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":true,"url":"https://api.github.com/repos/magiclabs/spree","forks_url":"https://api.github.com/repos/magiclabs/spree/forks","keys_url":"https://api.github.com/repos/magiclabs/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magiclabs/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magiclabs/spree/teams","hooks_url":"https://api.github.com/repos/magiclabs/spree/hooks","issue_events_url":"https://api.github.com/repos/magiclabs/spree/issues/events{/number}","events_url":"https://api.github.com/repos/magiclabs/spree/events","assignees_url":"https://api.github.com/repos/magiclabs/spree/assignees{/user}","branches_url":"https://api.github.com/repos/magiclabs/spree/branches{/branch}","tags_url":"https://api.github.com/repos/magiclabs/spree/tags","blobs_url":"https://api.github.com/repos/magiclabs/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magiclabs/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magiclabs/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/magiclabs/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magiclabs/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/magiclabs/spree/languages","stargazers_url":"https://api.github.com/repos/magiclabs/spree/stargazers","contributors_url":"https://api.github.com/repos/magiclabs/spree/contributors","subscribers_url":"https://api.github.com/repos/magiclabs/spree/subscribers","subscription_url":"https://api.github.com/repos/magiclabs/spree/subscription","commits_url":"https://api.github.com/repos/magiclabs/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/magiclabs/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/magiclabs/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/magiclabs/spree/issues/comments{/number}","contents_url":"https://api.github.com/repos/magiclabs/spree/contents/{+path}","compare_url":"https://api.github.com/repos/magiclabs/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magiclabs/spree/merges","archive_url":"https://api.github.com/repos/magiclabs/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magiclabs/spree/downloads","issues_url":"https://api.github.com/repos/magiclabs/spree/issues{/number}","pulls_url":"https://api.github.com/repos/magiclabs/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/magiclabs/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/magiclabs/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magiclabs/spree/labels{/name}","releases_url":"https://api.github.com/repos/magiclabs/spree/releases{/id}","created_at":"2011-06-22T08:19:20Z","updated_at":"2015-04-14T09:58:44Z","pushed_at":"2015-04-16T06:40:02Z","git_url":"git://github.com/magiclabs/spree.git","ssh_url":"git@github.com:magiclabs/spree.git","clone_url":"https://github.com/magiclabs/spree.git","svn_url":"https://github.com/magiclabs/spree","homepage":"http://spreecommerce.com","size":72639,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"spree:master","ref":"master","sha":"2c24c1e23dfdf4dec87ba83d049a646bdc60b80a","user":{"login":"spree","id":56702,"avatar_url":"https://avatars.githubusercontent.com/u/56702?v=3","gravatar_id":"","url":"https://api.github.com/users/spree","html_url":"https://github.com/spree","followers_url":"https://api.github.com/users/spree/followers","following_url":"https://api.github.com/users/spree/following{/other_user}","gists_url":"https://api.github.com/users/spree/gists{/gist_id}","starred_url":"https://api.github.com/users/spree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spree/subscriptions","organizations_url":"https://api.github.com/users/spree/orgs","repos_url":"https://api.github.com/users/spree/repos","events_url":"https://api.github.com/users/spree/events{/privacy}","received_events_url":"https://api.github.com/users/spree/received_events","type":"Organization","site_admin":false},"repo":{"id":3314,"name":"spree","full_name":"spree/spree","owner":{"login":"spree","id":56702,"avatar_url":"https://avatars.githubusercontent.com/u/56702?v=3","gravatar_id":"","url":"https://api.github.com/users/spree","html_url":"https://github.com/spree","followers_url":"https://api.github.com/users/spree/followers","following_url":"https://api.github.com/users/spree/following{/other_user}","gists_url":"https://api.github.com/users/spree/gists{/gist_id}","starred_url":"https://api.github.com/users/spree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spree/subscriptions","organizations_url":"https://api.github.com/users/spree/orgs","repos_url":"https://api.github.com/users/spree/repos","events_url":"https://api.github.com/users/spree/events{/privacy}","received_events_url":"https://api.github.com/users/spree/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spree/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":false,"url":"https://api.github.com/repos/spree/spree","forks_url":"https://api.github.com/repos/spree/spree/forks","keys_url":"https://api.github.com/repos/spree/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spree/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spree/spree/teams","hooks_url":"https://api.github.com/repos/spree/spree/hooks","issue_events_url":"https://api.github.com/repos/spree/spree/issues/events{/number}","events_url":"https://api.github.com/repos/spree/spree/events","assignees_url":"https://api.github.com/repos/spree/spree/assignees{/user}","branches_url":"https://api.github.com/repos/spree/spree/branches{/branch}","tags_url":"https://api.github.com/repos/spree/spree/tags","blobs_url":"https://api.github.com/repos/spree/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spree/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spree/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/spree/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spree/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/spree/spree/languages","stargazers_url":"https://api.github.com/repos/spree/spree/stargazers","contributors_url":"https://api.github.com/repos/spree/spree/contributors","subscribers_url":"https://api.github.com/repos/spree/spree/subscribers","subscription_url":"https://api.github.com/repos/spree/spree/subscription","commits_url":"https://api.github.com/repos/spree/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/spree/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/spree/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/spree/spree/issues/comments{/number}","contents_url":"https://api.github.com/repos/spree/spree/contents/{+path}","compare_url":"https://api.github.com/repos/spree/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spree/spree/merges","archive_url":"https://api.github.com/repos/spree/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spree/spree/downloads","issues_url":"https://api.github.com/repos/spree/spree/issues{/number}","pulls_url":"https://api.github.com/repos/spree/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/spree/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/spree/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spree/spree/labels{/name}","releases_url":"https://api.github.com/repos/spree/spree/releases{/id}","created_at":"2008-03-10T14:45:35Z","updated_at":"2015-04-15T23:53:05Z","pushed_at":"2015-04-16T06:43:31Z","git_url":"git://github.com/spree/spree.git","ssh_url":"git@github.com:spree/spree.git","clone_url":"https://github.com/spree/spree.git","svn_url":"https://github.com/spree/spree","homepage":"http://spreecommerce.com","size":134865,"stargazers_count":6229,"watchers_count":6229,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2914,"mirror_url":null,"open_issues_count":110,"forks":2914,"open_issues":110,"watchers":6229,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spree/spree/pulls/6295"},"html":{"href":"https://github.com/spree/spree/pull/6295"},"issue":{"href":"https://api.github.com/repos/spree/spree/issues/6295"},"comments":{"href":"https://api.github.com/repos/spree/spree/issues/6295/comments"},"review_comments":{"href":"https://api.github.com/repos/spree/spree/pulls/6295/comments"},"review_comment":{"href":"https://api.github.com/repos/spree/spree/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spree/spree/pulls/6295/commits"},"statuses":{"href":"https://api.github.com/repos/spree/spree/statuses/87166e5be5ef11f0d176eb910a355ccbb7b2188b"}}}}