{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/61031010","id":61031010,"diff_hunk":"@@ -10,7 +10,16 @@ class <<self\n       attr_accessor :default_formatting_rules\n \n       def from_money(money)\n-        new(money.to_d, currency: money.currency.iso_code)\n+        new(money)\n+      end\n+\n+      def parse(amount, currency = Spree::Config[:currency])\n+        new(parse_to_money(amount, currency))\n+      end\n+\n+      # @api private","path":"core/lib/spree/money.rb","position":18,"original_position":12,"commit_id":"559937396b8978e7633bdef2caa6538dcc3ff351","original_commit_id":"5117e3e5ad1db0b1f79aa8973fc9e867ea59a0b5","user":{"login":"tvdeyen","id":42868,"avatar_url":"https://avatars.githubusercontent.com/u/42868?v=3","gravatar_id":"","url":"https://api.github.com/users/tvdeyen","html_url":"https://github.com/tvdeyen","followers_url":"https://api.github.com/users/tvdeyen/followers","following_url":"https://api.github.com/users/tvdeyen/following{/other_user}","gists_url":"https://api.github.com/users/tvdeyen/gists{/gist_id}","starred_url":"https://api.github.com/users/tvdeyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tvdeyen/subscriptions","organizations_url":"https://api.github.com/users/tvdeyen/orgs","repos_url":"https://api.github.com/users/tvdeyen/repos","events_url":"https://api.github.com/users/tvdeyen/events{/privacy}","received_events_url":"https://api.github.com/users/tvdeyen/received_events","type":"User","site_admin":false},"body":"Aight","created_at":"2016-04-26T05:38:52Z","updated_at":"2016-04-26T05:38:52Z","html_url":"https://github.com/solidusio/solidus/pull/1083#discussion_r61031010","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/1083","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/61031010"},"html":{"href":"https://github.com/solidusio/solidus/pull/1083#discussion_r61031010"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1083"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/1083","id":67107114,"html_url":"https://github.com/solidusio/solidus/pull/1083","diff_url":"https://github.com/solidusio/solidus/pull/1083.diff","patch_url":"https://github.com/solidusio/solidus/pull/1083.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/1083","number":1083,"state":"open","locked":false,"title":"Deprecate parsing in Spree::Money.new","user":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"body":"Previously Spree::Money was always initialized with a string which would be parsed, like `\"$1.00 USD\"` or `\"$2,10 EUR\"`. This introduces a Spree::Money.parse which should be used instead for this type of input. Any currency passed in was appended to the `amount` string before parsing to end up with the correct currency.\r\n\r\nThis PR deprecates the complex parsing in `Spree::Money.new`, requiring either a Numeric or a string which is valid as input to `BigDecimal.new`. In solidus Money was already used in this way, but this deprecates the existing behaviour to be as safe as possible.\r\n\r\nThis now allows initializing `Spree::Money` with an existing `::Money` object. `Spree::Money.parse` was introduced to provide the existing behaviour, matching `Monetize.parse`.\r\n\r\nThis should be faster and less error-prone.\r\n\r\nInspired by @mamhoff's recent work improving Spree::Money","created_at":"2016-04-19T23:32:06Z","updated_at":"2016-04-26T05:38:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02b274898a62ec21e9d16b98e5559d6932d7c7df","assignee":null,"milestone":{"url":"https://api.github.com/repos/solidusio/solidus/milestones/6","html_url":"https://github.com/solidusio/solidus/milestones/1.3.0","labels_url":"https://api.github.com/repos/solidusio/solidus/milestones/6/labels","id":1490610,"number":6,"title":"1.3.0","description":"","creator":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":9,"state":"open","created_at":"2016-01-07T23:24:00Z","updated_at":"2016-04-25T20:25:52Z","due_on":"2016-05-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/1083/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/1083/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/1083/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/559937396b8978e7633bdef2caa6538dcc3ff351","head":{"label":"jhawthorn:mo_money_mo_problems","ref":"mo_money_mo_problems","sha":"559937396b8978e7633bdef2caa6538dcc3ff351","user":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"repo":{"id":37868303,"name":"solidus","full_name":"jhawthorn/solidus","owner":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhawthorn/solidus","description":"solidus ecommerce system","fork":true,"url":"https://api.github.com/repos/jhawthorn/solidus","forks_url":"https://api.github.com/repos/jhawthorn/solidus/forks","keys_url":"https://api.github.com/repos/jhawthorn/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhawthorn/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhawthorn/solidus/teams","hooks_url":"https://api.github.com/repos/jhawthorn/solidus/hooks","issue_events_url":"https://api.github.com/repos/jhawthorn/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/jhawthorn/solidus/events","assignees_url":"https://api.github.com/repos/jhawthorn/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/jhawthorn/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/jhawthorn/solidus/tags","blobs_url":"https://api.github.com/repos/jhawthorn/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhawthorn/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhawthorn/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhawthorn/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhawthorn/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/jhawthorn/solidus/languages","stargazers_url":"https://api.github.com/repos/jhawthorn/solidus/stargazers","contributors_url":"https://api.github.com/repos/jhawthorn/solidus/contributors","subscribers_url":"https://api.github.com/repos/jhawthorn/solidus/subscribers","subscription_url":"https://api.github.com/repos/jhawthorn/solidus/subscription","commits_url":"https://api.github.com/repos/jhawthorn/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhawthorn/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhawthorn/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhawthorn/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhawthorn/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/jhawthorn/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhawthorn/solidus/merges","archive_url":"https://api.github.com/repos/jhawthorn/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhawthorn/solidus/downloads","issues_url":"https://api.github.com/repos/jhawthorn/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/jhawthorn/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/jhawthorn/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/jhawthorn/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhawthorn/solidus/labels{/name}","releases_url":"https://api.github.com/repos/jhawthorn/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/jhawthorn/solidus/deployments","created_at":"2015-06-22T16:58:44Z","updated_at":"2016-01-15T05:22:53Z","pushed_at":"2016-04-26T00:54:19Z","git_url":"git://github.com/jhawthorn/solidus.git","ssh_url":"git@github.com:jhawthorn/solidus.git","clone_url":"https://github.com/jhawthorn/solidus.git","svn_url":"https://github.com/jhawthorn/solidus","homepage":"","size":63597,"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":"c0bcd30e09f922109ac1c1018d93e606d7257227","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-04-25T19:33:12Z","pushed_at":"2016-04-26T00:54:19Z","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":"http://solidus.io/","size":68785,"stargazers_count":901,"watchers_count":901,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":242,"mirror_url":null,"open_issues_count":107,"forks":242,"open_issues":107,"watchers":901,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1083"},"html":{"href":"https://github.com/solidusio/solidus/pull/1083"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1083"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1083/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1083/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1083/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/559937396b8978e7633bdef2caa6538dcc3ff351"}}}}