{"action":"created","comment":{"url":"https://api.github.com/repos/lotus/model/pulls/comments/28120495","id":28120495,"diff_hunk":"@@ -35,61 +35,73 @@\n \n       describe '.persist' do\n         describe 'when passed a non-persisted entity' do\n-          let(:user) { User.new(name: 'S', age: '3') }\n+          let(:unpersisted_user) { User.new(name: 'Don', age: '25') }\n \n           it 'should return that entity' do\n-            persisted_user = UserRepository.persist(user)\n+            persisted_user = UserRepository.persist(unpersisted_user)\n \n             persisted_user.id.wont_be_nil\n-            persisted_user.name.must_equal(user.name)\n-            persisted_user.age.must_equal(user.age.to_i)\n+            persisted_user.name.must_equal(unpersisted_user.name)\n+            persisted_user.age.must_equal(unpersisted_user.age.to_i)\n           end\n \n           it 'should coerce attributes' do\n-            persisted_user = UserRepository.persist(user)\n-            persisted_user.age.must_equal(3)\n+            persisted_user = UserRepository.persist(unpersisted_user)\n+            persisted_user.age.must_equal(25)\n+          end\n+\n+          it 'assigns and persist created_at attribute' do\n+            persisted_user = UserRepository.persist(unpersisted_user)\n+            persisted_user.created_at.must_equal persisted_user.created_at\n           end\n         end\n \n         describe 'when passed a persisted entity' do\n-          let(:user)                   { UserRepository.create(User.new(name: 'S')) }\n-          let(:already_persisted_user) { UserRepository.persist(user) }\n+\n+          let(:user)           { UserRepository.create(User.new(name: 'Don', age: '25')) }\n+          let(:persisted_user) { UserRepository.persist(user) }\n \n           it 'should return that entity' do\n-            UserRepository.persist(already_persisted_user).must_equal(user)\n+            UserRepository.persist(persisted_user).must_equal(user)\n+          end\n+\n+          it 'does not touch created_at' do\n+            UserRepository.persist(persisted_user)\n+            persisted_user.created_at.must_equal persisted_user.created_at\n           end\n         end\n \n         describe 'when non persisted' do","path":"test/repository_test.rb","position":49,"original_position":49,"commit_id":"858a2495be610c4fa3a0142ee417a79314b2947f","original_commit_id":"858a2495be610c4fa3a0142ee417a79314b2947f","user":{"login":"mymai91","id":6791942,"avatar_url":"https://avatars.githubusercontent.com/u/6791942?v=3","gravatar_id":"","url":"https://api.github.com/users/mymai91","html_url":"https://github.com/mymai91","followers_url":"https://api.github.com/users/mymai91/followers","following_url":"https://api.github.com/users/mymai91/following{/other_user}","gists_url":"https://api.github.com/users/mymai91/gists{/gist_id}","starred_url":"https://api.github.com/users/mymai91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mymai91/subscriptions","organizations_url":"https://api.github.com/users/mymai91/orgs","repos_url":"https://api.github.com/users/mymai91/repos","events_url":"https://api.github.com/users/mymai91/events{/privacy}","received_events_url":"https://api.github.com/users/mymai91/received_events","type":"User","site_admin":false},"body":"I saw it defined before. If it is really unnecessary. I'll remove.","created_at":"2015-04-10T03:16:45Z","updated_at":"2015-04-10T03:16:45Z","html_url":"https://github.com/lotus/model/pull/173#discussion_r28120495","pull_request_url":"https://api.github.com/repos/lotus/model/pulls/173","_links":{"self":{"href":"https://api.github.com/repos/lotus/model/pulls/comments/28120495"},"html":{"href":"https://github.com/lotus/model/pull/173#discussion_r28120495"},"pull_request":{"href":"https://api.github.com/repos/lotus/model/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/lotus/model/pulls/173","id":32634198,"html_url":"https://github.com/lotus/model/pull/173","diff_url":"https://github.com/lotus/model/pull/173.diff","patch_url":"https://github.com/lotus/model/pull/173.patch","issue_url":"https://api.github.com/repos/lotus/model/issues/173","number":173,"state":"open","locked":false,"title":"Update created at","user":{"login":"LeoTeam","id":11532617,"avatar_url":"https://avatars.githubusercontent.com/u/11532617?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoTeam","html_url":"https://github.com/LeoTeam","followers_url":"https://api.github.com/users/LeoTeam/followers","following_url":"https://api.github.com/users/LeoTeam/following{/other_user}","gists_url":"https://api.github.com/users/LeoTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoTeam/subscriptions","organizations_url":"https://api.github.com/users/LeoTeam/orgs","repos_url":"https://api.github.com/users/LeoTeam/repos","events_url":"https://api.github.com/users/LeoTeam/events{/privacy}","received_events_url":"https://api.github.com/users/LeoTeam/received_events","type":"User","site_admin":false},"body":"Addressed an issue https://github.com/lotus/model/issues/167\r\n","created_at":"2015-04-04T14:22:35Z","updated_at":"2015-04-10T03:16:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"695d605e8dcb172db3ff31febd1547ff454e739f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lotus/model/pulls/173/commits","review_comments_url":"https://api.github.com/repos/lotus/model/pulls/173/comments","review_comment_url":"https://api.github.com/repos/lotus/model/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lotus/model/issues/173/comments","statuses_url":"https://api.github.com/repos/lotus/model/statuses/858a2495be610c4fa3a0142ee417a79314b2947f","head":{"label":"LeoTeam:update-created-at","ref":"update-created-at","sha":"858a2495be610c4fa3a0142ee417a79314b2947f","user":{"login":"LeoTeam","id":11532617,"avatar_url":"https://avatars.githubusercontent.com/u/11532617?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoTeam","html_url":"https://github.com/LeoTeam","followers_url":"https://api.github.com/users/LeoTeam/followers","following_url":"https://api.github.com/users/LeoTeam/following{/other_user}","gists_url":"https://api.github.com/users/LeoTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoTeam/subscriptions","organizations_url":"https://api.github.com/users/LeoTeam/orgs","repos_url":"https://api.github.com/users/LeoTeam/repos","events_url":"https://api.github.com/users/LeoTeam/events{/privacy}","received_events_url":"https://api.github.com/users/LeoTeam/received_events","type":"User","site_admin":false},"repo":{"id":33321021,"name":"model","full_name":"LeoTeam/model","owner":{"login":"LeoTeam","id":11532617,"avatar_url":"https://avatars.githubusercontent.com/u/11532617?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoTeam","html_url":"https://github.com/LeoTeam","followers_url":"https://api.github.com/users/LeoTeam/followers","following_url":"https://api.github.com/users/LeoTeam/following{/other_user}","gists_url":"https://api.github.com/users/LeoTeam/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoTeam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoTeam/subscriptions","organizations_url":"https://api.github.com/users/LeoTeam/orgs","repos_url":"https://api.github.com/users/LeoTeam/repos","events_url":"https://api.github.com/users/LeoTeam/events{/privacy}","received_events_url":"https://api.github.com/users/LeoTeam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LeoTeam/model","description":"A persistence framework with entities, repositories, data mapper and query objects","fork":true,"url":"https://api.github.com/repos/LeoTeam/model","forks_url":"https://api.github.com/repos/LeoTeam/model/forks","keys_url":"https://api.github.com/repos/LeoTeam/model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LeoTeam/model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LeoTeam/model/teams","hooks_url":"https://api.github.com/repos/LeoTeam/model/hooks","issue_events_url":"https://api.github.com/repos/LeoTeam/model/issues/events{/number}","events_url":"https://api.github.com/repos/LeoTeam/model/events","assignees_url":"https://api.github.com/repos/LeoTeam/model/assignees{/user}","branches_url":"https://api.github.com/repos/LeoTeam/model/branches{/branch}","tags_url":"https://api.github.com/repos/LeoTeam/model/tags","blobs_url":"https://api.github.com/repos/LeoTeam/model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LeoTeam/model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LeoTeam/model/git/refs{/sha}","trees_url":"https://api.github.com/repos/LeoTeam/model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LeoTeam/model/statuses/{sha}","languages_url":"https://api.github.com/repos/LeoTeam/model/languages","stargazers_url":"https://api.github.com/repos/LeoTeam/model/stargazers","contributors_url":"https://api.github.com/repos/LeoTeam/model/contributors","subscribers_url":"https://api.github.com/repos/LeoTeam/model/subscribers","subscription_url":"https://api.github.com/repos/LeoTeam/model/subscription","commits_url":"https://api.github.com/repos/LeoTeam/model/commits{/sha}","git_commits_url":"https://api.github.com/repos/LeoTeam/model/git/commits{/sha}","comments_url":"https://api.github.com/repos/LeoTeam/model/comments{/number}","issue_comment_url":"https://api.github.com/repos/LeoTeam/model/issues/comments{/number}","contents_url":"https://api.github.com/repos/LeoTeam/model/contents/{+path}","compare_url":"https://api.github.com/repos/LeoTeam/model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LeoTeam/model/merges","archive_url":"https://api.github.com/repos/LeoTeam/model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LeoTeam/model/downloads","issues_url":"https://api.github.com/repos/LeoTeam/model/issues{/number}","pulls_url":"https://api.github.com/repos/LeoTeam/model/pulls{/number}","milestones_url":"https://api.github.com/repos/LeoTeam/model/milestones{/number}","notifications_url":"https://api.github.com/repos/LeoTeam/model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LeoTeam/model/labels{/name}","releases_url":"https://api.github.com/repos/LeoTeam/model/releases{/id}","created_at":"2015-04-02T17:02:18Z","updated_at":"2015-04-05T17:11:27Z","pushed_at":"2015-04-10T01:33:24Z","git_url":"git://github.com/LeoTeam/model.git","ssh_url":"git@github.com:LeoTeam/model.git","clone_url":"https://github.com/LeoTeam/model.git","svn_url":"https://github.com/LeoTeam/model","homepage":"","size":574,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"lotus:master","ref":"master","sha":"2848ca7a2e87d1cd24efaeda9923ab343f2e9fdb","user":{"login":"lotus","id":3210273,"avatar_url":"https://avatars.githubusercontent.com/u/3210273?v=3","gravatar_id":"","url":"https://api.github.com/users/lotus","html_url":"https://github.com/lotus","followers_url":"https://api.github.com/users/lotus/followers","following_url":"https://api.github.com/users/lotus/following{/other_user}","gists_url":"https://api.github.com/users/lotus/gists{/gist_id}","starred_url":"https://api.github.com/users/lotus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lotus/subscriptions","organizations_url":"https://api.github.com/users/lotus/orgs","repos_url":"https://api.github.com/users/lotus/repos","events_url":"https://api.github.com/users/lotus/events{/privacy}","received_events_url":"https://api.github.com/users/lotus/received_events","type":"Organization","site_admin":false},"repo":{"id":16760719,"name":"model","full_name":"lotus/model","owner":{"login":"lotus","id":3210273,"avatar_url":"https://avatars.githubusercontent.com/u/3210273?v=3","gravatar_id":"","url":"https://api.github.com/users/lotus","html_url":"https://github.com/lotus","followers_url":"https://api.github.com/users/lotus/followers","following_url":"https://api.github.com/users/lotus/following{/other_user}","gists_url":"https://api.github.com/users/lotus/gists{/gist_id}","starred_url":"https://api.github.com/users/lotus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lotus/subscriptions","organizations_url":"https://api.github.com/users/lotus/orgs","repos_url":"https://api.github.com/users/lotus/repos","events_url":"https://api.github.com/users/lotus/events{/privacy}","received_events_url":"https://api.github.com/users/lotus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lotus/model","description":"A persistence framework with entities, repositories, data mapper and query objects","fork":false,"url":"https://api.github.com/repos/lotus/model","forks_url":"https://api.github.com/repos/lotus/model/forks","keys_url":"https://api.github.com/repos/lotus/model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lotus/model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lotus/model/teams","hooks_url":"https://api.github.com/repos/lotus/model/hooks","issue_events_url":"https://api.github.com/repos/lotus/model/issues/events{/number}","events_url":"https://api.github.com/repos/lotus/model/events","assignees_url":"https://api.github.com/repos/lotus/model/assignees{/user}","branches_url":"https://api.github.com/repos/lotus/model/branches{/branch}","tags_url":"https://api.github.com/repos/lotus/model/tags","blobs_url":"https://api.github.com/repos/lotus/model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lotus/model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lotus/model/git/refs{/sha}","trees_url":"https://api.github.com/repos/lotus/model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lotus/model/statuses/{sha}","languages_url":"https://api.github.com/repos/lotus/model/languages","stargazers_url":"https://api.github.com/repos/lotus/model/stargazers","contributors_url":"https://api.github.com/repos/lotus/model/contributors","subscribers_url":"https://api.github.com/repos/lotus/model/subscribers","subscription_url":"https://api.github.com/repos/lotus/model/subscription","commits_url":"https://api.github.com/repos/lotus/model/commits{/sha}","git_commits_url":"https://api.github.com/repos/lotus/model/git/commits{/sha}","comments_url":"https://api.github.com/repos/lotus/model/comments{/number}","issue_comment_url":"https://api.github.com/repos/lotus/model/issues/comments{/number}","contents_url":"https://api.github.com/repos/lotus/model/contents/{+path}","compare_url":"https://api.github.com/repos/lotus/model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lotus/model/merges","archive_url":"https://api.github.com/repos/lotus/model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lotus/model/downloads","issues_url":"https://api.github.com/repos/lotus/model/issues{/number}","pulls_url":"https://api.github.com/repos/lotus/model/pulls{/number}","milestones_url":"https://api.github.com/repos/lotus/model/milestones{/number}","notifications_url":"https://api.github.com/repos/lotus/model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lotus/model/labels{/name}","releases_url":"https://api.github.com/repos/lotus/model/releases{/id}","created_at":"2014-02-12T08:25:42Z","updated_at":"2015-04-08T12:31:51Z","pushed_at":"2015-04-10T01:33:25Z","git_url":"git://github.com/lotus/model.git","ssh_url":"git@github.com:lotus/model.git","clone_url":"https://github.com/lotus/model.git","svn_url":"https://github.com/lotus/model","homepage":"","size":2634,"stargazers_count":192,"watchers_count":192,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":15,"forks":65,"open_issues":15,"watchers":192,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lotus/model/pulls/173"},"html":{"href":"https://github.com/lotus/model/pull/173"},"issue":{"href":"https://api.github.com/repos/lotus/model/issues/173"},"comments":{"href":"https://api.github.com/repos/lotus/model/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/lotus/model/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/lotus/model/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lotus/model/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/lotus/model/statuses/858a2495be610c4fa3a0142ee417a79314b2947f"}}}}