Patch #29674 » validate-record-list.patch
| lib/redmine/field_format.rb | ||
|---|---|---|
| 736 | 736 |
options |
| 737 | 737 |
end |
| 738 | 738 | |
| 739 |
def validate_custom_value(custom_value) |
|
| 740 |
values = Array.wrap(custom_value.value).reject {|value| value.to_s == ''}
|
|
| 741 |
invalid_values = values - possible_custom_value_options(custom_value).map(&:last) |
|
| 742 |
if invalid_values.any? |
|
| 743 |
[::I18n.t('activerecord.errors.messages.inclusion')]
|
|
| 744 |
else |
|
| 745 |
[] |
|
| 746 |
end |
|
| 747 |
end |
|
| 748 | ||
| 739 | 749 |
def order_statement(custom_field) |
| 740 | 750 |
if target_class.respond_to?(:fields_for_order_statement) |
| 741 | 751 |
target_class.fields_for_order_statement(value_join_alias(custom_field)) |