diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-19 13:30:08 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-19 13:30:08 +0000 |
commit | a605544acace52c688f21a92805dcee557b234b6 (patch) | |
tree | 694edb21ceabc7d7fff8df419151ab2be8eb6109 /lib/redmine/field_format.rb | |
parent | f49ab715f71db434c3b98517bd6b7703a99a1435 (diff) | |
download | redmine-a605544acace52c688f21a92805dcee557b234b6.tar.gz redmine-a605544acace52c688f21a92805dcee557b234b6.zip |
shorten long line of lib/redmine/field_format.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20430 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/field_format.rb')
-rw-r--r-- | lib/redmine/field_format.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index 9dd06c5b8..0b78e748b 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -44,15 +44,19 @@ module Redmine # Return an array of custom field formats which can be used in select_tag def self.as_select(class_name=nil) formats = all.values.select do |format| - format.class.customized_class_names.nil? || format.class.customized_class_names.include?(class_name) + format.class.customized_class_names.nil? || + format.class.customized_class_names.include?(class_name) end - formats.map {|format| [::I18n.t(format.label), format.name] }.sort_by(&:first) + formats.map do |format| + [::I18n.t(format.label), format.name] + end.sort_by(&:first) end # Returns an array of formats that can be used for a custom field class def self.formats_for_custom_field_class(klass=nil) all.values.select do |format| - format.class.customized_class_names.nil? || format.class.customized_class_names.include?(klass.name) + format.class.customized_class_names.nil? || + format.class.customized_class_names.include?(klass.name) end end @@ -596,7 +600,10 @@ module Redmine end def query_filter_options(custom_field, query) - {:type => :list_optional, :values => lambda { query_filter_values(custom_field, query) }} + { + :type => :list_optional, + :values => lambda {query_filter_values(custom_field, query)} + } end protected @@ -879,7 +886,9 @@ module Redmine field_attributes :version_status def possible_values_options(custom_field, object=nil) - possible_values_records(custom_field, object).sort.collect{|v| [v.to_s, v.id.to_s] } + possible_values_records(custom_field, object).sort.collect do |v| + [v.to_s, v.id.to_s] + end end def before_custom_field_save(custom_field) |