]> source.dussan.org Git - redmine.git/commitdiff
shorten long line of Query#sql_for_custom_field
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 12 Dec 2020 15:49:44 +0000 (15:49 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 12 Dec 2020 15:49:44 +0000 (15:49 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20640 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index 8b13611894f8b3e2471bf0d0bd2fc2c59e203dea..18f1b135bf4765fbdbdb3a7c02b4f40bee30c0a2 100644 (file)
@@ -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