diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-07 12:30:54 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-07 12:30:54 +0000 |
commit | d84e0366a1fbaa5e6b4e790bf2a52626a050eac9 (patch) | |
tree | 051ec5ff95c0f3942552d14e290da1f516047924 /app | |
parent | f19f4a948feb03771b6eb4f5455995e591d313d1 (diff) | |
download | redmine-d84e0366a1fbaa5e6b4e790bf2a52626a050eac9.tar.gz redmine-d84e0366a1fbaa5e6b4e790bf2a52626a050eac9.zip |
use "do end" instead of {} at app/models/issue_query.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20286 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/issue_query.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb index 79905b11a..aae3acf64 100644 --- a/app/models/issue_query.rb +++ b/app/models/issue_query.rb @@ -40,10 +40,10 @@ class IssueQuery < Query QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours", :totalable => true), QueryColumn.new( :total_estimated_hours, - :sortable => -> { + :sortable => -> do "COALESCE((SELECT SUM(estimated_hours) FROM #{Issue.table_name} subtasks" + " WHERE #{Issue.visible_condition(User.current).gsub(/\bissues\b/, 'subtasks')} AND subtasks.root_id = #{Issue.table_name}.root_id AND subtasks.lft >= #{Issue.table_name}.lft AND subtasks.rgt <= #{Issue.table_name}.rgt), 0)" - }, + end, :default_order => 'desc'), QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio", :groupable => true), TimestampQueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc', :groupable => true), @@ -265,9 +265,9 @@ class IssueQuery < Query disabled_fields = Tracker.disabled_core_fields(trackers).map {|field| field.sub(/_id$/, '')} disabled_fields << "total_estimated_hours" if disabled_fields.include?("estimated_hours") - @available_columns.reject! {|column| + @available_columns.reject! do |column| disabled_fields.include?(column.name.to_s) - } + end @available_columns end |