GitHub PullRequestReviewCommentEvent at 2014-02-14 13:34:46
Repository: redmine_better_crossprojects
Actor: jbbarth
Payload: {"comment":{"url":"https://api.github.com/repos/jbbarth/redmine_better_crossprojects/pulls/comments/9748106","id":9748106,"diff_hunk":"@@ -0,0 +1,149 @@\n+class ProjectQuery < Query\n+\n+  self.queried_class = Project\n+\n+  self.available_columns = [\n+      QueryColumn.new(:name, :sortable => \"#{Project.table_name}.name\", :groupable => true),\n+      QueryColumn.new(:parent, :sortable => \"#{Project.table_name}.name\", :caption => :field_parent),\n+      QueryColumn.new(:status, :sortable => \"#{Project.table_name}.status\", :groupable => true),\n+      QueryColumn.new(:is_public, :sortable => \"#{Project.table_name}.public\", :groupabel => true),\n+      QueryColumn.new(:created_on, :sortable => \"#{Project.table_name}.created_on\", :default_order => 'desc'),\n+      QueryColumn.new(:updated_on, :sortable => \"#{Project.table_name}.updated_on\", :default_order => 'desc'),\n+      QueryColumn.new(:activity, :sortable => false),\n+      QueryColumn.new(:issues, :sortable => false),\n+      QueryColumn.new(:description, :inline => false),\n+      QueryColumn.new(:role, :sortable => false),\n+      QueryColumn.new(:members, :sortable => false)\n+  ]\n+\n+  def initialize(attributes=nil, *args)\n+    super attributes\n+    self.filters ||= { 'status' => {:operator => \"=\", :values => [Project::STATUS_ACTIVE.to_s]} }\n+  end\n+\n+  def initialize_available_filters\n+    project_custom_fields = ProjectCustomField.all\n+\n+    project_values = all_projects_values\n+    add_available_filter(\"id\",\n+                         :type => :list_optional, :values => project_values\n+    ) unless project_values.empty?\n+\n+    principals = Principal.member_of(all_projects)\n+    principals.uniq!\n+    principals.sort!","path":"app/models/project_query.rb","position":34,"original_position":34,"commit_id":"1718ffb61275ebc85947027cad0e1372607f60b4","original_commit_id":"1718ffb61275ebc85947027cad0e1372607f60b4","user":{"login":"jbbarth","id":29363,"avatar_url":"https://gravatar.com/avatar/9a00ce848763a4472291fcbcefd31a07?d=https%3A%2F%2Fidenticons.github.com%2F689e29456db0e6f0b9a03e1e6c42b231.png&r=x","gravatar_id":"9a00ce848763a4472291fcbcefd31a07","url":"https://api.github.com/users/jbbarth","html_url":"https://github.com/jbbarth","followers_url":"https://api.github.com/users/jbbarth/followers","following_url":"https://api.github.com/users/jbbarth/following{/other_user}","gists_url":"https://api.github.com/users/jbbarth/gists{/gist_id}","starred_url":"https://api.github.com/users/jbbarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbbarth/subscriptions","organizations_url":"https://api.github.com/users/jbbarth/orgs","repos_url":"https://api.github.com/users/jbbarth/repos","events_url":"https://api.github.com/users/jbbarth/events{/privacy}","received_events_url":"https://api.github.com/users/jbbarth/received_events","type":"User","site_admin":false},"body":"Oops, I didn't see that this morning: same here, I guess this can be pretty slow too and may be optimized in some way (caching, asynchronous calculation, anything...)","created_at":"2014-02-14T13:34:46Z","updated_at":"2014-02-14T13:34:46Z","html_url":"https://github.com/jbbarth/redmine_better_crossprojects/pull/6#discussion_r9748106","pull_request_url":"https://api.github.com/repos/jbbarth/redmine_better_crossprojects/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/jbbarth/redmine_better_crossprojects/pulls/comments/9748106"},"html":{"href":"https://github.com/jbbarth/redmine_better_crossprojects/pull/6#discussion_r9748106"},"pull_request":{"href":"https://api.github.com/repos/jbbarth/redmine_better_crossprojects/pulls/6"}}}}