{"action":"created","comment":{"url":"https://api.github.com/repos/lotus/model/pulls/comments/27951397","id":27951397,"diff_hunk":"@@ -235,6 +267,30 @@ def update(attributes={})\n       end\n     end\n \n+    # Getter for hash of changed attributes.\n+    # Return empty hash, if there is no changes\n+    # Getter for hash of changed attributes. Value in it is the previous one.\n+    #\n+    # @return [::Hash] the changed attributes\n+    #\n+    # @since x.x.x\n+    #\n+    # @example\n+    #   require 'lotus/model'\n+    #   class Article\n+    #     include Lotus::Entity\n+    #     attributes :title\n+    #   end\n+    #\n+    #   article = Article.new(title: 'The crime and punishment')\n+    #   article.changed_attributes # => {}\n+    #   article.title = 'Master and Margarita'\n+    #   article.changed_attributes # => {:title => 'The crime and punishment'}\n+    #\n+    def changed_attributes\n+      @changed_attributes ||= Hash.new","path":"lib/lotus/entity.rb","position":98,"original_position":98,"commit_id":"fb0c98cfec3ad113b5b63481eac157997034685b","original_commit_id":"fb0c98cfec3ad113b5b63481eac157997034685b","user":{"login":"jodosha","id":5089,"avatar_url":"https://avatars.githubusercontent.com/u/5089?v=3","gravatar_id":"","url":"https://api.github.com/users/jodosha","html_url":"https://github.com/jodosha","followers_url":"https://api.github.com/users/jodosha/followers","following_url":"https://api.github.com/users/jodosha/following{/other_user}","gists_url":"https://api.github.com/users/jodosha/gists{/gist_id}","starred_url":"https://api.github.com/users/jodosha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodosha/subscriptions","organizations_url":"https://api.github.com/users/jodosha/orgs","repos_url":"https://api.github.com/users/jodosha/repos","events_url":"https://api.github.com/users/jodosha/events{/privacy}","received_events_url":"https://api.github.com/users/jodosha/received_events","type":"User","site_admin":false},"body":"This isn't thread safe, this ivar should be set when the entity is initialized. Then the getter should be:\r\n\r\n```ruby\r\ndef changed_attributes\r\n  @changed_attributes.dup\r\nend\r\n```\r\n\r\nIn this way we prevent accidental modifications of the internal state of the object. Here an example:\r\n\r\n```ruby\r\nbook.changed_attributes # => {:title => \"The crime and punishment\"}\r\nbook.changed_attributes.delete(:title)\r\nbook.changed_attributes # => {}\r\n```","created_at":"2015-04-08T08:30:43Z","updated_at":"2015-04-08T08:30:43Z","html_url":"https://github.com/lotus/model/pull/172#discussion_r27951397","pull_request_url":"https://api.github.com/repos/lotus/model/pulls/172","_links":{"self":{"href":"https://api.github.com/repos/lotus/model/pulls/comments/27951397"},"html":{"href":"https://github.com/lotus/model/pull/172#discussion_r27951397"},"pull_request":{"href":"https://api.github.com/repos/lotus/model/pulls/172"}}},"pull_request":{"url":"https://api.github.com/repos/lotus/model/pulls/172","id":32506485,"html_url":"https://github.com/lotus/model/pull/172","diff_url":"https://github.com/lotus/model/pull/172.diff","patch_url":"https://github.com/lotus/model/pull/172.patch","issue_url":"https://api.github.com/repos/lotus/model/issues/172","number":172,"state":"open","locked":false,"title":"Implementation of dirty check for entity","user":{"login":"dsnipe","id":1488587,"avatar_url":"https://avatars.githubusercontent.com/u/1488587?v=3","gravatar_id":"","url":"https://api.github.com/users/dsnipe","html_url":"https://github.com/dsnipe","followers_url":"https://api.github.com/users/dsnipe/followers","following_url":"https://api.github.com/users/dsnipe/following{/other_user}","gists_url":"https://api.github.com/users/dsnipe/gists{/gist_id}","starred_url":"https://api.github.com/users/dsnipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsnipe/subscriptions","organizations_url":"https://api.github.com/users/dsnipe/orgs","repos_url":"https://api.github.com/users/dsnipe/repos","events_url":"https://api.github.com/users/dsnipe/events{/privacy}","received_events_url":"https://api.github.com/users/dsnipe/received_events","type":"User","site_admin":false},"body":"#170 ","created_at":"2015-04-02T12:23:38Z","updated_at":"2015-04-08T08:30:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fcbd54ab4723d1ab10c058d7ce0e4a1f9686932","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lotus/model/pulls/172/commits","review_comments_url":"https://api.github.com/repos/lotus/model/pulls/172/comments","review_comment_url":"https://api.github.com/repos/lotus/model/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lotus/model/issues/172/comments","statuses_url":"https://api.github.com/repos/lotus/model/statuses/fb0c98cfec3ad113b5b63481eac157997034685b","head":{"label":"dsnipe:dirty-checks","ref":"dirty-checks","sha":"fb0c98cfec3ad113b5b63481eac157997034685b","user":{"login":"dsnipe","id":1488587,"avatar_url":"https://avatars.githubusercontent.com/u/1488587?v=3","gravatar_id":"","url":"https://api.github.com/users/dsnipe","html_url":"https://github.com/dsnipe","followers_url":"https://api.github.com/users/dsnipe/followers","following_url":"https://api.github.com/users/dsnipe/following{/other_user}","gists_url":"https://api.github.com/users/dsnipe/gists{/gist_id}","starred_url":"https://api.github.com/users/dsnipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsnipe/subscriptions","organizations_url":"https://api.github.com/users/dsnipe/orgs","repos_url":"https://api.github.com/users/dsnipe/repos","events_url":"https://api.github.com/users/dsnipe/events{/privacy}","received_events_url":"https://api.github.com/users/dsnipe/received_events","type":"User","site_admin":false},"repo":{"id":33125062,"name":"model","full_name":"dsnipe/model","owner":{"login":"dsnipe","id":1488587,"avatar_url":"https://avatars.githubusercontent.com/u/1488587?v=3","gravatar_id":"","url":"https://api.github.com/users/dsnipe","html_url":"https://github.com/dsnipe","followers_url":"https://api.github.com/users/dsnipe/followers","following_url":"https://api.github.com/users/dsnipe/following{/other_user}","gists_url":"https://api.github.com/users/dsnipe/gists{/gist_id}","starred_url":"https://api.github.com/users/dsnipe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsnipe/subscriptions","organizations_url":"https://api.github.com/users/dsnipe/orgs","repos_url":"https://api.github.com/users/dsnipe/repos","events_url":"https://api.github.com/users/dsnipe/events{/privacy}","received_events_url":"https://api.github.com/users/dsnipe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dsnipe/model","description":"A persistence framework with entities, repositories, data mapper and query objects","fork":true,"url":"https://api.github.com/repos/dsnipe/model","forks_url":"https://api.github.com/repos/dsnipe/model/forks","keys_url":"https://api.github.com/repos/dsnipe/model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dsnipe/model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dsnipe/model/teams","hooks_url":"https://api.github.com/repos/dsnipe/model/hooks","issue_events_url":"https://api.github.com/repos/dsnipe/model/issues/events{/number}","events_url":"https://api.github.com/repos/dsnipe/model/events","assignees_url":"https://api.github.com/repos/dsnipe/model/assignees{/user}","branches_url":"https://api.github.com/repos/dsnipe/model/branches{/branch}","tags_url":"https://api.github.com/repos/dsnipe/model/tags","blobs_url":"https://api.github.com/repos/dsnipe/model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dsnipe/model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dsnipe/model/git/refs{/sha}","trees_url":"https://api.github.com/repos/dsnipe/model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dsnipe/model/statuses/{sha}","languages_url":"https://api.github.com/repos/dsnipe/model/languages","stargazers_url":"https://api.github.com/repos/dsnipe/model/stargazers","contributors_url":"https://api.github.com/repos/dsnipe/model/contributors","subscribers_url":"https://api.github.com/repos/dsnipe/model/subscribers","subscription_url":"https://api.github.com/repos/dsnipe/model/subscription","commits_url":"https://api.github.com/repos/dsnipe/model/commits{/sha}","git_commits_url":"https://api.github.com/repos/dsnipe/model/git/commits{/sha}","comments_url":"https://api.github.com/repos/dsnipe/model/comments{/number}","issue_comment_url":"https://api.github.com/repos/dsnipe/model/issues/comments{/number}","contents_url":"https://api.github.com/repos/dsnipe/model/contents/{+path}","compare_url":"https://api.github.com/repos/dsnipe/model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dsnipe/model/merges","archive_url":"https://api.github.com/repos/dsnipe/model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dsnipe/model/downloads","issues_url":"https://api.github.com/repos/dsnipe/model/issues{/number}","pulls_url":"https://api.github.com/repos/dsnipe/model/pulls{/number}","milestones_url":"https://api.github.com/repos/dsnipe/model/milestones{/number}","notifications_url":"https://api.github.com/repos/dsnipe/model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dsnipe/model/labels{/name}","releases_url":"https://api.github.com/repos/dsnipe/model/releases{/id}","created_at":"2015-03-30T13:36:24Z","updated_at":"2015-04-02T08:54:25Z","pushed_at":"2015-04-06T13:16:23Z","git_url":"git://github.com/dsnipe/model.git","ssh_url":"git@github.com:dsnipe/model.git","clone_url":"https://github.com/dsnipe/model.git","svn_url":"https://github.com/dsnipe/model","homepage":"","size":610,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"lotus:master","ref":"master","sha":"1e08124a6b6916c43754fd2fe0baf13e06676bc7","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-06T11:21:37Z","pushed_at":"2015-04-07T16:51:59Z","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/172"},"html":{"href":"https://github.com/lotus/model/pull/172"},"issue":{"href":"https://api.github.com/repos/lotus/model/issues/172"},"comments":{"href":"https://api.github.com/repos/lotus/model/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/lotus/model/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/lotus/model/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lotus/model/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/lotus/model/statuses/fb0c98cfec3ad113b5b63481eac157997034685b"}}}}