{"action":"opened","number":39,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/39","id":48586746,"html_url":"https://github.com/thoughtbot/ex_machina/pull/39","diff_url":"https://github.com/thoughtbot/ex_machina/pull/39.diff","patch_url":"https://github.com/thoughtbot/ex_machina/pull/39.patch","issue_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues/39","number":39,"state":"open","locked":false,"title":"Return to using functions for factory definitions","user":{"login":"jsteiner","id":466493,"avatar_url":"https://avatars.githubusercontent.com/u/466493?v=3","gravatar_id":"","url":"https://api.github.com/users/jsteiner","html_url":"https://github.com/jsteiner","followers_url":"https://api.github.com/users/jsteiner/followers","following_url":"https://api.github.com/users/jsteiner/following{/other_user}","gists_url":"https://api.github.com/users/jsteiner/gists{/gist_id}","starred_url":"https://api.github.com/users/jsteiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsteiner/subscriptions","organizations_url":"https://api.github.com/users/jsteiner/orgs","repos_url":"https://api.github.com/users/jsteiner/repos","events_url":"https://api.github.com/users/jsteiner/events{/privacy}","received_events_url":"https://api.github.com/users/jsteiner/received_events","type":"User","site_admin":false},"body":"Functions have less complexity and less magic than normal functions.\r\n\r\nThe functional approach also provides access to the `attrs` hash, which\r\nallows you to utilize it in your factory definition:\r\n\r\n    def factory :user, attrs do\r\n      modified_attrs = attrs |> modify_attrs\r\n      %{\r\n        name: \"Foobar\",\r\n        accounts: assoc(modified_attrs, :accounts),\r\n      }\r\n    end","created_at":"2015-10-23T14:30:04Z","updated_at":"2015-10-23T14:30:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/39/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/39/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues/39/comments","statuses_url":"https://api.github.com/repos/thoughtbot/ex_machina/statuses/6a60a7a70c033f12a76d7d0bf850f8a1624b25a6","head":{"label":"thoughtbot:js-back-to-functions","ref":"js-back-to-functions","sha":"6a60a7a70c033f12a76d7d0bf850f8a1624b25a6","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":42458047,"name":"ex_machina","full_name":"thoughtbot/ex_machina","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/ex_machina","description":"Create test data for Elixir applications","fork":false,"url":"https://api.github.com/repos/thoughtbot/ex_machina","forks_url":"https://api.github.com/repos/thoughtbot/ex_machina/forks","keys_url":"https://api.github.com/repos/thoughtbot/ex_machina/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/ex_machina/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/ex_machina/teams","hooks_url":"https://api.github.com/repos/thoughtbot/ex_machina/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/ex_machina/events","assignees_url":"https://api.github.com/repos/thoughtbot/ex_machina/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/ex_machina/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/ex_machina/tags","blobs_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/ex_machina/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/ex_machina/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/ex_machina/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/ex_machina/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/ex_machina/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/ex_machina/subscription","commits_url":"https://api.github.com/repos/thoughtbot/ex_machina/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/ex_machina/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/ex_machina/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/ex_machina/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/ex_machina/merges","archive_url":"https://api.github.com/repos/thoughtbot/ex_machina/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/ex_machina/downloads","issues_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/ex_machina/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/ex_machina/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/ex_machina/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/ex_machina/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/ex_machina/releases{/id}","created_at":"2015-09-14T15:40:28Z","updated_at":"2015-10-23T03:53:58Z","pushed_at":"2015-10-23T14:29:17Z","git_url":"git://github.com/thoughtbot/ex_machina.git","ssh_url":"git@github.com:thoughtbot/ex_machina.git","clone_url":"https://github.com/thoughtbot/ex_machina.git","svn_url":"https://github.com/thoughtbot/ex_machina","homepage":"http://hexdocs.pm/ex_machina/overview.html","size":573,"stargazers_count":32,"watchers_count":32,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":32,"default_branch":"master"}},"base":{"label":"thoughtbot:0.4.0","ref":"0.4.0","sha":"1ff4198488caa8225563ec2d4262a6f42d7d29be","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":42458047,"name":"ex_machina","full_name":"thoughtbot/ex_machina","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/ex_machina","description":"Create test data for Elixir applications","fork":false,"url":"https://api.github.com/repos/thoughtbot/ex_machina","forks_url":"https://api.github.com/repos/thoughtbot/ex_machina/forks","keys_url":"https://api.github.com/repos/thoughtbot/ex_machina/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/ex_machina/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/ex_machina/teams","hooks_url":"https://api.github.com/repos/thoughtbot/ex_machina/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/ex_machina/events","assignees_url":"https://api.github.com/repos/thoughtbot/ex_machina/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/ex_machina/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/ex_machina/tags","blobs_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/ex_machina/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/ex_machina/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/ex_machina/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/ex_machina/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/ex_machina/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/ex_machina/subscription","commits_url":"https://api.github.com/repos/thoughtbot/ex_machina/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/ex_machina/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/ex_machina/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/ex_machina/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/ex_machina/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/ex_machina/merges","archive_url":"https://api.github.com/repos/thoughtbot/ex_machina/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/ex_machina/downloads","issues_url":"https://api.github.com/repos/thoughtbot/ex_machina/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/ex_machina/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/ex_machina/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/ex_machina/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/ex_machina/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/ex_machina/releases{/id}","created_at":"2015-09-14T15:40:28Z","updated_at":"2015-10-23T03:53:58Z","pushed_at":"2015-10-23T14:29:17Z","git_url":"git://github.com/thoughtbot/ex_machina.git","ssh_url":"git@github.com:thoughtbot/ex_machina.git","clone_url":"https://github.com/thoughtbot/ex_machina.git","svn_url":"https://github.com/thoughtbot/ex_machina","homepage":"http://hexdocs.pm/ex_machina/overview.html","size":573,"stargazers_count":32,"watchers_count":32,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/39"},"html":{"href":"https://github.com/thoughtbot/ex_machina/pull/39"},"issue":{"href":"https://api.github.com/repos/thoughtbot/ex_machina/issues/39"},"comments":{"href":"https://api.github.com/repos/thoughtbot/ex_machina/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/ex_machina/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/ex_machina/statuses/6a60a7a70c033f12a76d7d0bf850f8a1624b25a6"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":34,"deletions":47,"changed_files":6}}