From: Toshi MARUYAMA Date: Sat, 12 Dec 2020 15:49:44 +0000 (+0000) Subject: shorten long line of Query#sql_for_custom_field X-Git-Tag: 4.2.0~179 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a91da01ade434c2e58ab63f1a045aaba501e0817;p=redmine.git shorten long line of Query#sql_for_custom_field git-svn-id: http://svn.redmine.org/redmine/trunk@20640 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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