From 77bc6e11ff4d881756d98ba853d706f92b3ace8f Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 12 Feb 2013 00:51:11 +0000 Subject: [PATCH] remove trailing white-spaces from app/models/custom_field.rb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11354 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/custom_field.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 356417c4b..c15192388 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -172,7 +172,7 @@ class CustomField < ActiveRecord::Base keyword end end - + # Returns a ORDER BY clause that can used to sort customized # objects by their value of the custom field. # Returns nil if the custom field can not be used for sorting. @@ -196,7 +196,7 @@ class CustomField < ActiveRecord::Base # Returns a GROUP BY clause that can used to group by custom value # Returns nil if the custom field can not be used for grouping. - def group_statement + def group_statement return nil if multiple? case field_format when 'list', 'date', 'bool', 'int' @@ -342,8 +342,8 @@ class CustomField < ActiveRecord::Base def handle_multiplicity_change if !new_record? && multiple_was && !multiple ids = custom_values. - where("EXISTS(SELECT 1 FROM #{CustomValue.table_name} cve WHERE cve.custom_field_id = #{CustomValue.table_name}.custom_field_id" + - " AND cve.customized_type = #{CustomValue.table_name}.customized_type AND cve.customized_id = #{CustomValue.table_name}.customized_id" + + where("EXISTS(SELECT 1 FROM #{CustomValue.table_name} cve WHERE cve.custom_field_id = #{CustomValue.table_name}.custom_field_id" + + " AND cve.customized_type = #{CustomValue.table_name}.customized_type AND cve.customized_id = #{CustomValue.table_name}.customized_id" + " AND cve.id > #{CustomValue.table_name}.id)"). pluck(:id) -- 2.39.5