@@ -80,7 +80,7 class CustomField < ActiveRecord::Base | |||
|
80 | 80 | when 'bool' |
|
81 | 81 | [[l(:general_text_Yes), '1'], [l(:general_text_No), '0']] |
|
82 | 82 | else |
|
83 |
read_ |
|
|
83 | read_possible_values_utf8_encoded || [] | |
|
84 | 84 | end |
|
85 | 85 | end |
|
86 | 86 | |
@@ -91,7 +91,7 class CustomField < ActiveRecord::Base | |||
|
91 | 91 | when 'bool' |
|
92 | 92 | ['1', '0'] |
|
93 | 93 | else |
|
94 |
read_ |
|
|
94 | read_possible_values_utf8_encoded | |
|
95 | 95 | end |
|
96 | 96 | end |
|
97 | 97 | |
@@ -218,4 +218,14 class CustomField < ActiveRecord::Base | |||
|
218 | 218 | end |
|
219 | 219 | errs |
|
220 | 220 | end |
|
221 | ||
|
222 | def read_possible_values_utf8_encoded | |
|
223 | values = read_attribute(:possible_values) | |
|
224 | if values.is_a?(Array) | |
|
225 | values.each do |value| | |
|
226 | value.force_encoding('UTF-8') if value.respond_to?(:force_encoding) | |
|
227 | end | |
|
228 | end | |
|
229 | values | |
|
230 | end | |
|
221 | 231 | end |
General Comments 0
You need to be logged in to leave comments.
Login now