GitHub PullRequestReviewCommentEvent at 2014-11-04 07:49:02
Repository: openproject
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/opf/openproject/pulls/comments/19788873","id":19788873,"diff_hunk":"@@ -213,74 +214,93 @@ def initialize(model, options = {}, *expand)\n           end unless visible_children.empty?\n         end\n \n-        property :id, getter: -> (*) { model.id }, render_nil: true\n+        property :id, render_nil: true\n         property :lock_version\n         property :subject, render_nil: true\n         property :type, render_nil: true\n-        property :description, render_nil: true\n-        property :raw_description, render_nil: true\n+        property :description, exec_context: :decorator, render_nil: true, writeable: false\n+        property :raw_description,\n+                 getter: -> (*) { description },\n+                 setter: -> (value, *) { self.description = value },\n+                 render_nil: true\n         property :status, render_nil: true\n-        property :is_closed\n+        property :is_closed, getter: -> (*) { closed? }\n         property :priority, render_nil: true\n-        property :start_date, getter: -> (*) { model.start_date.to_datetime.utc.iso8601 unless model.start_date.nil? }, render_nil: true\n-        property :due_date, getter: -> (*) { model.due_date.to_datetime.utc.iso8601 unless model.due_date.nil? }, render_nil: true\n-        property :estimated_time, render_nil: true\n+        property :start_date, getter: -> (*) { start_date.to_datetime.utc.iso8601 unless start_date.nil? }, render_nil: true\n+        property :due_date, getter: -> (*) { due_date.to_datetime.utc.iso8601 unless due_date.nil? }, render_nil: true\n+        property :estimated_time,\n+                 getter: -> (*) {\n+                                  { units: I18n.t(:'datetime.units.hour', count: estimated_hours.to_i),\n+                                    value: estimated_hours }\n+                                },\n+                 setter: -> (value, *) { self.estimated_hours = ActiveSupport::JSON.decode(value)['value'] },\n+                 render_nil: true\n         property :percentage_done,\n                  render_nil: true,\n                  exec_context: :decorator,\n-                 setter: -> (value, *) { represented.percentage_done = value },\n+                 setter: -> (value, *) { self.done_ratio = value },\n                  writeable: false\n-        property :version_id, getter: -> (*) { model.fixed_version.try(:id) }, render_nil: true\n-        property :version_name,  getter: -> (*) { model.fixed_version.try(:name) }, render_nil: true\n-        property :project_id, getter: -> (*) { model.project.id }\n-        property :project_name, getter: -> (*) { model.project.try(:name) }\n+        property :version_id,\n+                 getter: -> (*) { fixed_version.try(:id) },\n+                 setter: -> (value, *) { self.fixed_version_id = value },\n+                 render_nil: true\n+        property :version_name,  getter: -> (*) { fixed_version.try(:name) }, render_nil: true\n+        property :project_id, getter: -> (*) { project.id }\n+        property :project_name, getter: -> (*) { project.try(:name) }\n         property :parent_id, writeable: true\n-        property :created_at, getter: -> (*) { model.created_at.utc.iso8601 }, render_nil: true\n-        property :updated_at, getter: -> (*) { model.updated_at.utc.iso8601 }, render_nil: true\n+        property :created_at, getter: -> (*) { created_at.utc.iso8601 }, render_nil: true\n+        property :updated_at, getter: -> (*) { updated_at.utc.iso8601 }, render_nil: true\n \n         collection :custom_properties, exec_context: :decorator, render_nil: true\n \n-        property :author, embedded: true, class: ::API::V3::Users::UserModel, decorator: ::API::V3::Users::UserRepresenter, if: -> (*) { !author.nil? }\n-        property :responsible, embedded: true, class: ::API::V3::Users::UserModel, decorator: ::API::V3::Users::UserRepresenter, if: -> (*) { !responsible.nil? }\n-        property :assignee, embedded: true, class: ::API::V3::Users::UserModel, decorator: ::API::V3::Users::UserRepresenter, if: -> (*) { !assignee.nil? }\n-        property :category, embedded: true, class: ::API::V3::Categories::CategoryModel, decorator: ::API::V3::Categories::CategoryRepresenter, if: -> (*) { !category.nil? }\n+        property :author, embedded: true, class: ::User, decorator: ::API::V3::Users::UserRepresenter, if: -> (*) { !author.nil? }\n+        property :responsible, embedded: true, class: ::User, decorator: ::API::V3::Users::UserRepresenter, if: -> (*) { !responsible.nil? }\n+        property :assigned_to, as: :assignee, embedded: true, class: ::User, decorator: ::API::V3::Users::UserRepresenter, if: -> (*) { !assigned_to.nil? }\n+        property :category, embedded: true, class: ::Category, decorator: ::API::V3::Categories::CategoryRepresenter, if: -> (*) { !category.nil? }\n \n         property :activities, embedded: true, exec_context: :decorator\n-        property :watchers, embedded: true, exec_context: :decorator, if: -> (*) { current_user_allowed_to(:view_work_package_watchers, represented.model) }\n-        collection :attachments, embedded: true, class: ::API::V3::Attachments::AttachmentModel, decorator: ::API::V3::Attachments::AttachmentRepresenter\n+        property :watchers, embedded: true, exec_context: :decorator, if: -> (*) { current_user_allowed_to(:view_work_package_watchers, represented) }\n+        collection :attachments, embedded: true, class: ::Attachment, decorator: ::API::V3::Attachments::AttachmentRepresenter\n         property :relations, embedded: true, exec_context: :decorator\n \n         def _type\n           'WorkPackage'\n         end\n \n+        def description\n+          format_text(represented, :description)\n+        end\n+\n         def activities\n-          represented.activities.map{ |activity| ::API::V3::Activities::ActivityRepresenter.new(activity, current_user: @current_user) }\n+          represented.journals.map { |activity| ::API::V3::Activities::ActivityRepresenter.new(activity, current_user: @current_user) }\n         end\n \n         def watchers\n-          represented.watchers.map{ |watcher| ::API::V3::Users::UserRepresenter.new(watcher, work_package: represented.model, current_user: @current_user) }\n+          watchers = represented.watcher_users.order(User::USER_FORMATS_STRUCTURE[Setting.user_format])\n+          watchers.map { |watcher| ::API::V3::Users::UserRepresenter.new(watcher, work_package: represented, current_user: @current_user) }\n         end\n \n         def relations\n-          represented.relations.map{ |relation| RelationRepresenter.new(relation, work_package: represented.model, current_user: @current_user) }\n+          relations = represented.relations\n+          visible_relations = relations.select { |relation| relation.other_work_package(represented).visible? }\n+          visible_relations.map { |relation| RelationRepresenter.new(relation, work_package: represented, current_user: @current_user) }\n         end\n \n         def custom_properties\n-            values = represented.model.custom_field_values\n+            values = represented.custom_field_values","path":"lib/api/v3/work_packages/work_package_representer.rb","position":327,"original_position":327,"commit_id":"916df7dcbb5c902a9f1adcd01ca4b739b57382c2","original_commit_id":"916df7dcbb5c902a9f1adcd01ca4b739b57382c2","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=2","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":"Use 2 (not 4) spaces for indentation.","created_at":"2014-11-04T07:49:02Z","updated_at":"2014-11-04T07:49:02Z","html_url":"https://github.com/opf/openproject/pull/2103#discussion_r19788873","pull_request_url":"https://api.github.com/repos/opf/openproject/pulls/2103","_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/19788873"},"html":{"href":"https://github.com/opf/openproject/pull/2103#discussion_r19788873"},"pull_request":{"href":"https://api.github.com/repos/opf/openproject/pulls/2103"}}},"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/2103","id":23529002,"html_url":"https://github.com/opf/openproject/pull/2103","diff_url":"https://github.com/opf/openproject/pull/2103.diff","patch_url":"https://github.com/opf/openproject/pull/2103.patch","issue_url":"https://api.github.com/repos/opf/openproject/issues/2103","number":2103,"state":"open","locked":false,"title":"16983 api extend wp patch for description","user":{"login":"hschink","id":2000842,"avatar_url":"https://avatars.githubusercontent.com/u/2000842?v=2","gravatar_id":"","url":"https://api.github.com/users/hschink","html_url":"https://github.com/hschink","followers_url":"https://api.github.com/users/hschink/followers","following_url":"https://api.github.com/users/hschink/following{/other_user}","gists_url":"https://api.github.com/users/hschink/gists{/gist_id}","starred_url":"https://api.github.com/users/hschink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hschink/subscriptions","organizations_url":"https://api.github.com/users/hschink/orgs","repos_url":"https://api.github.com/users/hschink/repos","events_url":"https://api.github.com/users/hschink/events{/privacy}","received_events_url":"https://api.github.com/users/hschink/received_events","type":"User","site_admin":false},"body":"[``* `#16983` Extend API V3's work package PATCH endpoint for description``](https://community.openproject.org/work_packages/16983)","created_at":"2014-10-29T13:16:22Z","updated_at":"2014-11-04T07:49:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a667d3d8dbbc7adb4e50e7d4f1cfab0f84589ad7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opf/openproject/pulls/2103/commits","review_comments_url":"https://api.github.com/repos/opf/openproject/pulls/2103/comments","review_comment_url":"https://api.github.com/repos/opf/openproject/pulls/comments/{number}","comments_url":"https://api.github.com/repos/opf/openproject/issues/2103/comments","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/916df7dcbb5c902a9f1adcd01ca4b739b57382c2","head":{"label":"opf:feature/16983_api_extend_wp_patch_for_description","ref":"feature/16983_api_extend_wp_patch_for_description","sha":"916df7dcbb5c902a9f1adcd01ca4b739b57382c2","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments/{number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2014-11-03T08:09:40Z","pushed_at":"2014-11-04T07:48:41Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":182180,"stargazers_count":380,"watchers_count":380,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":192,"mirror_url":null,"open_issues_count":46,"forks":192,"open_issues":46,"watchers":380,"default_branch":"dev"}},"base":{"label":"opf:dev","ref":"dev","sha":"2d4796feb4a8e43a556ab42068f3a9d2d5b39ffc","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=2","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments/{number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2014-11-03T08:09:40Z","pushed_at":"2014-11-04T07:48:41Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":182180,"stargazers_count":380,"watchers_count":380,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":192,"mirror_url":null,"open_issues_count":46,"forks":192,"open_issues":46,"watchers":380,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/2103"},"html":{"href":"https://github.com/opf/openproject/pull/2103"},"issue":{"href":"https://api.github.com/repos/opf/openproject/issues/2103"},"comments":{"href":"https://api.github.com/repos/opf/openproject/issues/2103/comments"},"review_comments":{"href":"https://api.github.com/repos/opf/openproject/pulls/2103/comments"},"review_comment":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/opf/openproject/pulls/2103/commits"},"statuses":{"href":"https://api.github.com/repos/opf/openproject/statuses/916df7dcbb5c902a9f1adcd01ca4b739b57382c2"}}}}