Add an option to render Integer and Float custom fields with thousands delimiters (#39997).

Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@22935 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-07-18 04:56:20 +00:00
parent b374db2fdb
commit ee31bf8fe9
6 changed files with 30 additions and 5 deletions

View File

@@ -100,7 +100,9 @@ class CustomField < ApplicationRecord
'user_role',
'version_status',
'extensions_allowed',
'full_width_layout')
'full_width_layout',
'thousands_delimiter'
)
def copy_from(arg, options={})
return if arg.blank?
@@ -225,6 +227,10 @@ class CustomField < ApplicationRecord
text_formatting == 'full'
end
def thousands_delimiter?
thousands_delimiter == '1'
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.