diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-02-12 00:51:11 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2013-02-12 00:51:11 +0000 |
commit | 77bc6e11ff4d881756d98ba853d706f92b3ace8f (patch) | |
tree | 66b2e314b9fb2c9b18d29d9a3c38c8c5c7b87eac /app | |
parent | 204abe392bb8aba44406f223b214bf2245b93975 (diff) | |
download | redmine-77bc6e11ff4d881756d98ba853d706f92b3ace8f.tar.gz redmine-77bc6e11ff4d881756d98ba853d706f92b3ace8f.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/models/custom_field.rb | 8 |
1 files 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) |