Class: QueryCustomFieldColumn
- Inherits:
-
QueryColumn
- Object
- QueryColumn
- QueryCustomFieldColumn
- Defined in:
- app/models/query.rb
Instance Method Summary
- - (Object) caption
- - (Object) custom_field
-
- (QueryCustomFieldColumn) initialize(custom_field)
constructor
A new instance of QueryCustomFieldColumn.
- - (Object) value(issue)
Methods inherited from QueryColumn
Methods included from Redmine::I18n
#current_language, #day_name, #find_language, #format_date, #format_time, included, #l, #l_hours, #l_or_humanize, #ll, #month_name, #set_language_if_valid, #valid_languages
Constructor Details
- (QueryCustomFieldColumn) initialize(custom_field)
A new instance of QueryCustomFieldColumn
49 50 51 52 53 54 55 56 57 |
# File 'app/models/query.rb', line 49 def initialize(custom_field) self.name = "cf_#{custom_field.id}".to_sym self.sortable = custom_field.order_statement || false if %w(list date bool int).include?(custom_field.field_format) self.groupable = custom_field.order_statement end self.groupable ||= false @cf = custom_field end |
Instance Method Details
- (Object) caption
59 60 61 |
# File 'app/models/query.rb', line 59 def caption @cf.name end |
- (Object) custom_field
63 64 65 |
# File 'app/models/query.rb', line 63 def custom_field @cf end |
- (Object) value(issue)
67 68 69 70 |
# File 'app/models/query.rb', line 67 def value(issue) cv = issue.custom_values.detect {|v| v.custom_field_id == @cf.id} cv && @cf.cast_value(cv.value) end |