{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/70145524","id":70145524,"diff_hunk":"@@ -6,7 +6,7 @@\n FactoryGirl.define do\n   factory :payment, aliases: [:credit_card_payment], class: Spree::Payment do\n     association(:payment_method, factory: :credit_card_payment_method)\n-    association(:source, factory: :credit_card)\n+    source { create(:credit_card, user: order.user) }","path":"core/lib/spree/testing_support/factories/payment_factory.rb","position":5,"original_position":5,"commit_id":"e481393a7411d5937982a92aa40d42b7abea28cc","original_commit_id":"e481393a7411d5937982a92aa40d42b7abea28cc","user":{"login":"stewart","id":489142,"avatar_url":"https://avatars.githubusercontent.com/u/489142?v=3","gravatar_id":"","url":"https://api.github.com/users/stewart","html_url":"https://github.com/stewart","followers_url":"https://api.github.com/users/stewart/followers","following_url":"https://api.github.com/users/stewart/following{/other_user}","gists_url":"https://api.github.com/users/stewart/gists{/gist_id}","starred_url":"https://api.github.com/users/stewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewart/subscriptions","organizations_url":"https://api.github.com/users/stewart/orgs","repos_url":"https://api.github.com/users/stewart/repos","events_url":"https://api.github.com/users/stewart/events{/privacy}","received_events_url":"https://api.github.com/users/stewart/received_events","type":"User","site_admin":false},"body":"I don't believe that will work, as `order` will be evaluated at the time of factory definition, as opposed to when a factory instance is created.\r\n\r\n    [...]/payment_factory.rb:9:in `block (2 levels) in <top (required)>': undefined method `user' for #<FactoryGirl::Declaration::Implicit:0x007f0bfda556d0> (NoMethodError)","created_at":"2016-07-08T21:43:39Z","updated_at":"2016-07-08T21:43:39Z","html_url":"https://github.com/solidusio/solidus/pull/1289#discussion_r70145524","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/1289","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/70145524"},"html":{"href":"https://github.com/solidusio/solidus/pull/1289#discussion_r70145524"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1289"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/1289","id":75885750,"html_url":"https://github.com/solidusio/solidus/pull/1289","diff_url":"https://github.com/solidusio/solidus/pull/1289.diff","patch_url":"https://github.com/solidusio/solidus/pull/1289.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/1289","number":1289,"state":"open","locked":false,"title":"Payment Factory should associate source with User","user":{"login":"stewart","id":489142,"avatar_url":"https://avatars.githubusercontent.com/u/489142?v=3","gravatar_id":"","url":"https://api.github.com/users/stewart","html_url":"https://github.com/stewart","followers_url":"https://api.github.com/users/stewart/followers","following_url":"https://api.github.com/users/stewart/following{/other_user}","gists_url":"https://api.github.com/users/stewart/gists{/gist_id}","starred_url":"https://api.github.com/users/stewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewart/subscriptions","organizations_url":"https://api.github.com/users/stewart/orgs","repos_url":"https://api.github.com/users/stewart/repos","events_url":"https://api.github.com/users/stewart/events{/privacy}","received_events_url":"https://api.github.com/users/stewart/received_events","type":"User","site_admin":false},"body":"In the process of creating a Payment via the factories, a new CreditCard\r\nrecord is created, but not associated with any user.\r\n\r\nIf we create a Payment via one of the Order factories, this can be quite\r\nconfusing, as the created Order may have a payment, but the created\r\nCredit Card associated with the payment is not associated with the User\r\nthat created the order.\r\n\r\nTo correct this, we can provide the order's associated user to the\r\ncredit card we create as the payment source.\r\n","created_at":"2016-06-30T20:32:16Z","updated_at":"2016-07-08T21:43:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e4e0a3a6b531a8425a94a93e9b5ad8008e0d6ba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/1289/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/1289/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/1289/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/e481393a7411d5937982a92aa40d42b7abea28cc","head":{"label":"stewart:fix/payment-factory","ref":"fix/payment-factory","sha":"e481393a7411d5937982a92aa40d42b7abea28cc","user":{"login":"stewart","id":489142,"avatar_url":"https://avatars.githubusercontent.com/u/489142?v=3","gravatar_id":"","url":"https://api.github.com/users/stewart","html_url":"https://github.com/stewart","followers_url":"https://api.github.com/users/stewart/followers","following_url":"https://api.github.com/users/stewart/following{/other_user}","gists_url":"https://api.github.com/users/stewart/gists{/gist_id}","starred_url":"https://api.github.com/users/stewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewart/subscriptions","organizations_url":"https://api.github.com/users/stewart/orgs","repos_url":"https://api.github.com/users/stewart/repos","events_url":"https://api.github.com/users/stewart/events{/privacy}","received_events_url":"https://api.github.com/users/stewart/received_events","type":"User","site_admin":false},"repo":{"id":45264960,"name":"solidus","full_name":"stewart/solidus","owner":{"login":"stewart","id":489142,"avatar_url":"https://avatars.githubusercontent.com/u/489142?v=3","gravatar_id":"","url":"https://api.github.com/users/stewart","html_url":"https://github.com/stewart","followers_url":"https://api.github.com/users/stewart/followers","following_url":"https://api.github.com/users/stewart/following{/other_user}","gists_url":"https://api.github.com/users/stewart/gists{/gist_id}","starred_url":"https://api.github.com/users/stewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewart/subscriptions","organizations_url":"https://api.github.com/users/stewart/orgs","repos_url":"https://api.github.com/users/stewart/repos","events_url":"https://api.github.com/users/stewart/events{/privacy}","received_events_url":"https://api.github.com/users/stewart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stewart/solidus","description":"Solidus, Rails eCommerce System","fork":true,"url":"https://api.github.com/repos/stewart/solidus","forks_url":"https://api.github.com/repos/stewart/solidus/forks","keys_url":"https://api.github.com/repos/stewart/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stewart/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stewart/solidus/teams","hooks_url":"https://api.github.com/repos/stewart/solidus/hooks","issue_events_url":"https://api.github.com/repos/stewart/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/stewart/solidus/events","assignees_url":"https://api.github.com/repos/stewart/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/stewart/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/stewart/solidus/tags","blobs_url":"https://api.github.com/repos/stewart/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stewart/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stewart/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/stewart/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stewart/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/stewart/solidus/languages","stargazers_url":"https://api.github.com/repos/stewart/solidus/stargazers","contributors_url":"https://api.github.com/repos/stewart/solidus/contributors","subscribers_url":"https://api.github.com/repos/stewart/solidus/subscribers","subscription_url":"https://api.github.com/repos/stewart/solidus/subscription","commits_url":"https://api.github.com/repos/stewart/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/stewart/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/stewart/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/stewart/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/stewart/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/stewart/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stewart/solidus/merges","archive_url":"https://api.github.com/repos/stewart/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stewart/solidus/downloads","issues_url":"https://api.github.com/repos/stewart/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/stewart/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/stewart/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/stewart/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stewart/solidus/labels{/name}","releases_url":"https://api.github.com/repos/stewart/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/stewart/solidus/deployments","created_at":"2015-10-30T17:05:39Z","updated_at":"2016-06-24T18:21:07Z","pushed_at":"2016-07-04T23:13:24Z","git_url":"git://github.com/stewart/solidus.git","ssh_url":"git@github.com:stewart/solidus.git","clone_url":"https://github.com/stewart/solidus.git","svn_url":"https://github.com/stewart/solidus","homepage":"http://solidus.io/","size":63769,"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":"e88a7011917a8c9d1ae9162f783c484e4786d364","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-07-08T18:30:36Z","pushed_at":"2016-07-08T18:45:22Z","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":69988,"stargazers_count":1001,"watchers_count":1001,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":292,"mirror_url":null,"open_issues_count":147,"forks":292,"open_issues":147,"watchers":1001,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1289"},"html":{"href":"https://github.com/solidusio/solidus/pull/1289"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1289"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1289/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1289/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1289/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/e481393a7411d5937982a92aa40d42b7abea28cc"}}}}
{"actor":{"display_login":"stewart"}}