summaryrefslogtreecommitdiffstats
path: root/app/models/custom_field.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-03 11:21:03 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-03 11:21:03 +0000
commit0135dc504a251f2d685b4ace20960437de087b83 (patch)
tree67b9887e646d829eca2206817d434cad37f8fd0e /app/models/custom_field.rb
parent9c561f912435d92a21afcfe07bac6a3cf9d462ba (diff)
downloadredmine-0135dc504a251f2d685b4ace20960437de087b83.tar.gz
redmine-0135dc504a251f2d685b4ace20960437de087b83.zip
SQLServer: The size (60) given to the type 'decimal' exceeds the maximum allowed (#12713).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11098 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_field.rb')
-rw-r--r--app/models/custom_field.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 77441149f..40582ff73 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -188,7 +188,7 @@ class CustomField < ActiveRecord::Base
# Make the database cast values into numeric
# Postgresql will raise an error if a value can not be casted!
# CustomValue validations should ensure that it doesn't occur
- "(SELECT CAST(cv_sort.value AS decimal(60,3)) FROM #{CustomValue.table_name} cv_sort" +
+ "(SELECT CAST(cv_sort.value AS decimal(30,3)) FROM #{CustomValue.table_name} cv_sort" +
" WHERE cv_sort.customized_type='#{self.class.customized_class.base_class.name}'" +
" AND cv_sort.customized_id=#{self.class.customized_class.table_name}.id" +
" AND cv_sort.custom_field_id=#{id} AND cv_sort.value <> '' AND cv_sort.value IS NOT NULL LIMIT 1)"
@@ -229,7 +229,7 @@ class CustomField < ActiveRecord::Base
" AND #{join_alias}_2.customized_id = #{join_alias}.customized_id" +
" AND #{join_alias}_2.custom_field_id = #{join_alias}.custom_field_id)" +
" LEFT OUTER JOIN #{value_class.table_name} #{value_join_alias}" +
- " ON CAST(#{join_alias}.value as decimal(60,0)) = #{value_join_alias}.id"
+ " ON CAST(#{join_alias}.value as decimal(30,0)) = #{value_join_alias}.id"
else
nil
end