Index: app/models/query.rb IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- app/models/query.rb (revision d378343c236b493d472aac023413e65e5af0f44b) +++ app/models/query.rb (revision ) @@ -163,10 +163,11 @@ class QueryFilter include Redmine::I18n - def initialize(field, options) + def initialize(queried_class, field, options) @field = field.to_s @options = options - @options[:name] ||= l(options[:label] || "field_#{field}".gsub(/_id$/, '')) + field_name = field.gsub(/_id$/, '') + @options[:name] ||= l(options[:label], default: queried_class.human_attribute_name(field_name)) # Consider filters with a Proc for values as remote by default @remote = options.key?(:remote) ? options[:remote] : options[:values].is_a?(Proc) end @@ -579,7 +580,7 @@ # Adds an available filter def add_available_filter(field, options) @available_filters ||= ActiveSupport::OrderedHash.new - @available_filters[field] = QueryFilter.new(field, options) + @available_filters[field] = QueryFilter.new(queried_class, field, options) @available_filters end