@@ -6,19 +6,14 module ActiveRecord | |||
|
6 | 6 | # Translate attribute names for validation errors display |
|
7 | 7 | def self.human_attribute_name(attr, options = {}) |
|
8 | 8 | prepared_attr = attr.to_s.sub(/_id$/, '').sub(/^.+\./, '') |
|
9 | class_prefix = name.underscore.gsub('/', '_') | |
|
9 | 10 | |
|
10 | redmine_default = | |
|
11 | [ | |
|
12 |
|
|
|
13 | :"field_#{prepared_attr}" | |
|
14 | ] | |
|
15 | ||
|
16 | if options[:default].present? | |
|
17 | options[:default] = [options[:default]] unless options[:default].is_a? Array | |
|
18 | options[:default].unshift redmine_default | |
|
19 | else | |
|
20 | options[:default] = redmine_default | |
|
21 | end | |
|
11 | redmine_default = [ | |
|
12 | :"field_#{class_prefix}_#{prepared_attr}", | |
|
13 | :"field_#{prepared_attr}" | |
|
14 | ] | |
|
15 | ||
|
16 | options[:default] = redmine_default + Array(options[:default]) | |
|
22 | 17 | |
|
23 | 18 | super |
|
24 | 19 | end |
General Comments 0
You need to be logged in to leave comments.
Login now