summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-12 15:49:44 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-12-12 15:49:44 +0000
commita91da01ade434c2e58ab63f1a045aaba501e0817 (patch)
tree5750d3e2669afe7b190dd8780960fff58acd80c6 /app/models/query.rb
parentfd112cb766001b2d71bc3379c117c439d76b6f7f (diff)
downloadredmine-a91da01ade434c2e58ab63f1a045aaba501e0817.tar.gz
redmine-a91da01ade434c2e58ab63f1a045aaba501e0817.zip
shorten long line of Query#sql_for_custom_field
git-svn-id: http://svn.redmine.org/redmine/trunk@20640 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index 8b1361189..18f1b135b 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -1129,9 +1129,11 @@ class Query < ActiveRecord::Base
if /[<>]/.match?(operator)
where = "(#{where}) AND #{db_table}.#{db_field} <> ''"
end
- "#{queried_table_name}.#{customized_key} #{not_in} IN (" +
- "SELECT #{customized_class.table_name}.id FROM #{customized_class.table_name}" +
- " LEFT OUTER JOIN #{db_table} ON #{db_table}.customized_type='#{customized_class}' AND #{db_table}.customized_id=#{customized_class.table_name}.id AND #{db_table}.custom_field_id=#{custom_field_id}" +
+ "#{queried_table_name}.#{customized_key} #{not_in} IN (" \
+ "SELECT #{customized_class.table_name}.id FROM #{customized_class.table_name}" \
+ " LEFT OUTER JOIN #{db_table} ON #{db_table}.customized_type='#{customized_class}'" \
+ " AND #{db_table}.customized_id=#{customized_class.table_name}.id" \
+ " AND #{db_table}.custom_field_id=#{custom_field_id}" \
" WHERE (#{where}) AND (#{filter[:field].visibility_by_project_condition}))"
end