{"action":"created","comment":{"url":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/44926373","id":44926373,"diff_hunk":"@@ -384,49 +378,65 @@ def response?\n   end\n \n   def same_email_as_previous_send?\n-    prev_addr = self.info_request.get_previous_email_sent_to(self)\n-    curr_addr = self.params[:email]\n+    prev_addr = info_request.get_previous_email_sent_to(self)\n+    curr_addr = params[:email]\n     if prev_addr.nil? && curr_addr.nil?\n       return true\n     end\n     if prev_addr.nil? || curr_addr.nil?\n       return false\n     end\n-    return MailHandler.address_from_string(prev_addr) == MailHandler.address_from_string(curr_addr)\n+    MailHandler.address_from_string(prev_addr) == MailHandler.address_from_string(curr_addr)\n   end\n \n   def json_for_api(deep, snippet_highlight_proc = nil)\n     ret = {\n-      :id => self.id,\n-      :event_type => self.event_type,\n+      :id => id,\n+      :event_type => event_type,\n       # params_yaml has possibly sensitive data in it, don't include it\n-      :created_at => self.created_at,\n-      :described_state => self.described_state,\n-      :calculated_state => self.calculated_state,\n-      :last_described_at => self.last_described_at,\n-      :incoming_message_id => self.incoming_message_id,\n-      :outgoing_message_id => self.outgoing_message_id,\n-      :comment_id => self.comment_id,\n+      :created_at => created_at,\n+      :described_state => described_state,\n+      :calculated_state => calculated_state,\n+      :last_described_at => last_described_at,\n+      :incoming_message_id => incoming_message_id,\n+      :outgoing_message_id => outgoing_message_id,\n+      :comment_id => comment_id,\n \n       # TODO: would be nice to add links here, but alas the\n       # code to make them is in views only. See views/request/details.html.erb\n       # perhaps can call with @template somehow\n     }\n \n-    if self.is_incoming_message? || self.is_outgoing_message?\n-      ret[:display_status] = self.display_status\n+    if is_incoming_message? || is_outgoing_message?\n+      ret[:display_status] = display_status\n     end\n \n-    if !snippet_highlight_proc.nil?\n-      ret[:snippet] = snippet_highlight_proc.call(self.search_text_main(true))\n+    if snippet_highlight_proc\n+      ret[:snippet] = snippet_highlight_proc.call(search_text_main(true))\n     end\n \n     if deep\n-      ret[:info_request] = self.info_request.json_for_api(false)\n-      ret[:public_body] = self.info_request.public_body.json_for_api\n-      ret[:user] = self.info_request.user_json_for_api\n+      ret[:info_request] = info_request.json_for_api(false)\n+      ret[:public_body] = info_request.public_body.json_for_api\n+      ret[:user] = info_request.user_json_for_api\n+    end\n+\n+    ret\n+  end\n+\n+  def set_calculated_state!(state)\n+    unless calculated_state == state\n+      self.calculated_state = state\n+      self.last_described_at = Time.now","path":"app/models/info_request_event.rb","position":414,"original_position":414,"commit_id":"d3bd3db4ea85590877b526aee4eeaa224ed25290","original_commit_id":"d3bd3db4ea85590877b526aee4eeaa224ed25290","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Do not use `Time.now` without zone. Use one of `Time.zone.now`, `Time.now.current`, `Time.now.in_time_zone`, `Time.now.utc`, `Time.now.getlocal`, `Time.now.iso8601`, `Time.now.jisx0301`, `Time.now.rfc3339`, `Time.now.to_i`, `Time.now.to_f` instead.","created_at":"2015-11-16T14:08:47Z","updated_at":"2015-11-16T14:08:47Z","html_url":"https://github.com/mysociety/alaveteli/pull/2903#discussion_r44926373","pull_request_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903","_links":{"self":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/44926373"},"html":{"href":"https://github.com/mysociety/alaveteli/pull/2903#discussion_r44926373"},"pull_request":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903"}}},"pull_request":{"url":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903","id":50813836,"html_url":"https://github.com/mysociety/alaveteli/pull/2903","diff_url":"https://github.com/mysociety/alaveteli/pull/2903.diff","patch_url":"https://github.com/mysociety/alaveteli/pull/2903.patch","issue_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2903","number":2903,"state":"open","locked":false,"title":"Release 0.23","user":{"login":"crowbot","id":2912,"avatar_url":"https://avatars.githubusercontent.com/u/2912?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbot","html_url":"https://github.com/crowbot","followers_url":"https://api.github.com/users/crowbot/followers","following_url":"https://api.github.com/users/crowbot/following{/other_user}","gists_url":"https://api.github.com/users/crowbot/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbot/subscriptions","organizations_url":"https://api.github.com/users/crowbot/orgs","repos_url":"https://api.github.com/users/crowbot/repos","events_url":"https://api.github.com/users/crowbot/events{/privacy}","received_events_url":"https://api.github.com/users/crowbot/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-16T14:08:22Z","updated_at":"2015-11-16T14:08:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f653a976853e2599c7b180bb25e35e08c7922357","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903/commits","review_comments_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903/comments","review_comment_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2903/comments","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/d3bd3db4ea85590877b526aee4eeaa224ed25290","head":{"label":"mysociety:release/0.23","ref":"release/0.23","sha":"d3bd3db4ea85590877b526aee4eeaa224ed25290","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":1125389,"name":"alaveteli","full_name":"mysociety/alaveteli","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/alaveteli","description":"Provide a Freedom of Information request system for your jurisdiction","fork":false,"url":"https://api.github.com/repos/mysociety/alaveteli","forks_url":"https://api.github.com/repos/mysociety/alaveteli/forks","keys_url":"https://api.github.com/repos/mysociety/alaveteli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/alaveteli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/alaveteli/teams","hooks_url":"https://api.github.com/repos/mysociety/alaveteli/hooks","issue_events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/alaveteli/events","assignees_url":"https://api.github.com/repos/mysociety/alaveteli/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/alaveteli/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/alaveteli/tags","blobs_url":"https://api.github.com/repos/mysociety/alaveteli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/alaveteli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/alaveteli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/alaveteli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/alaveteli/languages","stargazers_url":"https://api.github.com/repos/mysociety/alaveteli/stargazers","contributors_url":"https://api.github.com/repos/mysociety/alaveteli/contributors","subscribers_url":"https://api.github.com/repos/mysociety/alaveteli/subscribers","subscription_url":"https://api.github.com/repos/mysociety/alaveteli/subscription","commits_url":"https://api.github.com/repos/mysociety/alaveteli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/alaveteli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/alaveteli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/alaveteli/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/alaveteli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/alaveteli/merges","archive_url":"https://api.github.com/repos/mysociety/alaveteli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/alaveteli/downloads","issues_url":"https://api.github.com/repos/mysociety/alaveteli/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/alaveteli/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/alaveteli/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/alaveteli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/alaveteli/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/alaveteli/releases{/id}","created_at":"2010-11-30T13:11:39Z","updated_at":"2015-11-05T01:01:49Z","pushed_at":"2015-11-16T14:08:22Z","git_url":"git://github.com/mysociety/alaveteli.git","ssh_url":"git@github.com:mysociety/alaveteli.git","clone_url":"https://github.com/mysociety/alaveteli.git","svn_url":"https://github.com/mysociety/alaveteli","homepage":"http://alaveteli.org","size":118384,"stargazers_count":159,"watchers_count":159,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":104,"mirror_url":null,"open_issues_count":708,"forks":104,"open_issues":708,"watchers":159,"default_branch":"develop"}},"base":{"label":"mysociety:master","ref":"master","sha":"d613144668f221da492022837bc1d0e68287d8e5","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":1125389,"name":"alaveteli","full_name":"mysociety/alaveteli","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/alaveteli","description":"Provide a Freedom of Information request system for your jurisdiction","fork":false,"url":"https://api.github.com/repos/mysociety/alaveteli","forks_url":"https://api.github.com/repos/mysociety/alaveteli/forks","keys_url":"https://api.github.com/repos/mysociety/alaveteli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/alaveteli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/alaveteli/teams","hooks_url":"https://api.github.com/repos/mysociety/alaveteli/hooks","issue_events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/alaveteli/events","assignees_url":"https://api.github.com/repos/mysociety/alaveteli/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/alaveteli/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/alaveteli/tags","blobs_url":"https://api.github.com/repos/mysociety/alaveteli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/alaveteli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/alaveteli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/alaveteli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/alaveteli/languages","stargazers_url":"https://api.github.com/repos/mysociety/alaveteli/stargazers","contributors_url":"https://api.github.com/repos/mysociety/alaveteli/contributors","subscribers_url":"https://api.github.com/repos/mysociety/alaveteli/subscribers","subscription_url":"https://api.github.com/repos/mysociety/alaveteli/subscription","commits_url":"https://api.github.com/repos/mysociety/alaveteli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/alaveteli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/alaveteli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/alaveteli/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/alaveteli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/alaveteli/merges","archive_url":"https://api.github.com/repos/mysociety/alaveteli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/alaveteli/downloads","issues_url":"https://api.github.com/repos/mysociety/alaveteli/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/alaveteli/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/alaveteli/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/alaveteli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/alaveteli/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/alaveteli/releases{/id}","created_at":"2010-11-30T13:11:39Z","updated_at":"2015-11-05T01:01:49Z","pushed_at":"2015-11-16T14:08:22Z","git_url":"git://github.com/mysociety/alaveteli.git","ssh_url":"git@github.com:mysociety/alaveteli.git","clone_url":"https://github.com/mysociety/alaveteli.git","svn_url":"https://github.com/mysociety/alaveteli","homepage":"http://alaveteli.org","size":118384,"stargazers_count":159,"watchers_count":159,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":104,"mirror_url":null,"open_issues_count":708,"forks":104,"open_issues":708,"watchers":159,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903"},"html":{"href":"https://github.com/mysociety/alaveteli/pull/2903"},"issue":{"href":"https://api.github.com/repos/mysociety/alaveteli/issues/2903"},"comments":{"href":"https://api.github.com/repos/mysociety/alaveteli/issues/2903/comments"},"review_comments":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903/comments"},"review_comment":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/2903/commits"},"statuses":{"href":"https://api.github.com/repos/mysociety/alaveteli/statuses/d3bd3db4ea85590877b526aee4eeaa224ed25290"}}}}