{"action":"closed","number":1223,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/1223","id":226194583,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MTk0NTgz","html_url":"https://github.com/thoughtbot/factory_bot/pull/1223","diff_url":"https://github.com/thoughtbot/factory_bot/pull/1223.diff","patch_url":"https://github.com/thoughtbot/factory_bot/pull/1223.patch","issue_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1223","number":1223,"state":"closed","locked":false,"title":"Allow timestamp assignment in stubbed models","user":{"login":"composerinteralia","id":13696143,"node_id":"MDQ6VXNlcjEzNjk2MTQz","avatar_url":"https://avatars3.githubusercontent.com/u/13696143?v=4","gravatar_id":"","url":"https://api.github.com/users/composerinteralia","html_url":"https://github.com/composerinteralia","followers_url":"https://api.github.com/users/composerinteralia/followers","following_url":"https://api.github.com/users/composerinteralia/following{/other_user}","gists_url":"https://api.github.com/users/composerinteralia/gists{/gist_id}","starred_url":"https://api.github.com/users/composerinteralia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/composerinteralia/subscriptions","organizations_url":"https://api.github.com/users/composerinteralia/orgs","repos_url":"https://api.github.com/users/composerinteralia/repos","events_url":"https://api.github.com/users/composerinteralia/events{/privacy}","received_events_url":"https://api.github.com/users/composerinteralia/received_events","type":"User","site_admin":false},"body":"Closes  #1058\r\n\r\nBefore this change the build_stubbed strategy would override `#created_at` and `#updated_at`. The new methods store the times in `@created_at` and `@updated_at` instance variables, rather than in `@attributes`. This could cause unexpected behavior when using `#created_at=` or #updated_at=`. As an example, this would fail:\r\n\r\n```rb\r\npost = build_stubbed(:post)\r\ntimestamp = 1.month.ago\r\npost.created_at = timestamp\r\nexpect(post.created_at).to eq(timestamp)\r\n```\r\n\r\nInstead of overriding these methods, we can have build_stubbed set the values using `#created_at=` and `#updated_at=`. We need to do this after calling `clear_changes_information` or else we end up with an incorrect timezone.","created_at":"2018-10-26T18:56:51Z","updated_at":"2018-10-26T19:39:33Z","closed_at":"2018-10-26T19:39:33Z","merged_at":"2018-10-26T19:39:33Z","merge_commit_sha":"e7f66fb2ba8e7368d4b40587496a9309714405f5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/1223/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/1223/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1223/comments","statuses_url":"https://api.github.com/repos/thoughtbot/factory_bot/statuses/a3fd0676249099f50d5de70b9ced6423174ec92c","head":{"label":"thoughtbot:timestamps","ref":"timestamps","sha":"a3fd0676249099f50d5de70b9ced6423174ec92c","user":{"login":"thoughtbot","id":6183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/6183?v=4","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":21829,"node_id":"MDEwOlJlcG9zaXRvcnkyMTgyOQ==","name":"factory_bot","full_name":"thoughtbot/factory_bot","private":false,"owner":{"login":"thoughtbot","id":6183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/6183?v=4","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},"html_url":"https://github.com/thoughtbot/factory_bot","description":"A library for setting up Ruby objects as test data.","fork":false,"url":"https://api.github.com/repos/thoughtbot/factory_bot","forks_url":"https://api.github.com/repos/thoughtbot/factory_bot/forks","keys_url":"https://api.github.com/repos/thoughtbot/factory_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/factory_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/factory_bot/teams","hooks_url":"https://api.github.com/repos/thoughtbot/factory_bot/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/factory_bot/events","assignees_url":"https://api.github.com/repos/thoughtbot/factory_bot/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/factory_bot/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/factory_bot/tags","blobs_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/factory_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/factory_bot/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/factory_bot/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/factory_bot/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/factory_bot/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/factory_bot/subscription","commits_url":"https://api.github.com/repos/thoughtbot/factory_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/factory_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/factory_bot/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/factory_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/factory_bot/merges","archive_url":"https://api.github.com/repos/thoughtbot/factory_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/factory_bot/downloads","issues_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/factory_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/factory_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/factory_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/factory_bot/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/factory_bot/releases{/id}","deployments_url":"https://api.github.com/repos/thoughtbot/factory_bot/deployments","created_at":"2008-06-03T13:55:37Z","updated_at":"2018-10-26T14:51:14Z","pushed_at":"2018-10-26T19:39:32Z","git_url":"git://github.com/thoughtbot/factory_bot.git","ssh_url":"git@github.com:thoughtbot/factory_bot.git","clone_url":"https://github.com/thoughtbot/factory_bot.git","svn_url":"https://github.com/thoughtbot/factory_bot","homepage":"https://thoughtbot.com/open-source","size":2103,"stargazers_count":6178,"watchers_count":6178,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1656,"mirror_url":null,"archived":false,"open_issues_count":40,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1656,"open_issues":40,"watchers":6178,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"0c17434b4a35256a20e5ce60559345e398f64721","user":{"login":"thoughtbot","id":6183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/6183?v=4","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":21829,"node_id":"MDEwOlJlcG9zaXRvcnkyMTgyOQ==","name":"factory_bot","full_name":"thoughtbot/factory_bot","private":false,"owner":{"login":"thoughtbot","id":6183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/6183?v=4","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},"html_url":"https://github.com/thoughtbot/factory_bot","description":"A library for setting up Ruby objects as test data.","fork":false,"url":"https://api.github.com/repos/thoughtbot/factory_bot","forks_url":"https://api.github.com/repos/thoughtbot/factory_bot/forks","keys_url":"https://api.github.com/repos/thoughtbot/factory_bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/factory_bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/factory_bot/teams","hooks_url":"https://api.github.com/repos/thoughtbot/factory_bot/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/factory_bot/events","assignees_url":"https://api.github.com/repos/thoughtbot/factory_bot/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/factory_bot/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/factory_bot/tags","blobs_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/factory_bot/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/factory_bot/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/factory_bot/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/factory_bot/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/factory_bot/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/factory_bot/subscription","commits_url":"https://api.github.com/repos/thoughtbot/factory_bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/factory_bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/factory_bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/factory_bot/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/factory_bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/factory_bot/merges","archive_url":"https://api.github.com/repos/thoughtbot/factory_bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/factory_bot/downloads","issues_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/factory_bot/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/factory_bot/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/factory_bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/factory_bot/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/factory_bot/releases{/id}","deployments_url":"https://api.github.com/repos/thoughtbot/factory_bot/deployments","created_at":"2008-06-03T13:55:37Z","updated_at":"2018-10-26T14:51:14Z","pushed_at":"2018-10-26T19:39:32Z","git_url":"git://github.com/thoughtbot/factory_bot.git","ssh_url":"git@github.com:thoughtbot/factory_bot.git","clone_url":"https://github.com/thoughtbot/factory_bot.git","svn_url":"https://github.com/thoughtbot/factory_bot","homepage":"https://thoughtbot.com/open-source","size":2103,"stargazers_count":6178,"watchers_count":6178,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1656,"mirror_url":null,"archived":false,"open_issues_count":40,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1656,"open_issues":40,"watchers":6178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/1223"},"html":{"href":"https://github.com/thoughtbot/factory_bot/pull/1223"},"issue":{"href":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1223"},"comments":{"href":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1223/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/1223/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/factory_bot/pulls/1223/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/factory_bot/statuses/a3fd0676249099f50d5de70b9ced6423174ec92c"}},"author_association":"MEMBER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"composerinteralia","id":13696143,"node_id":"MDQ6VXNlcjEzNjk2MTQz","avatar_url":"https://avatars3.githubusercontent.com/u/13696143?v=4","gravatar_id":"","url":"https://api.github.com/users/composerinteralia","html_url":"https://github.com/composerinteralia","followers_url":"https://api.github.com/users/composerinteralia/followers","following_url":"https://api.github.com/users/composerinteralia/following{/other_user}","gists_url":"https://api.github.com/users/composerinteralia/gists{/gist_id}","starred_url":"https://api.github.com/users/composerinteralia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/composerinteralia/subscriptions","organizations_url":"https://api.github.com/users/composerinteralia/orgs","repos_url":"https://api.github.com/users/composerinteralia/repos","events_url":"https://api.github.com/users/composerinteralia/events{/privacy}","received_events_url":"https://api.github.com/users/composerinteralia/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":36,"deletions":20,"changed_files":2}}
{"actor":{"display_login":"composerinteralia"}}