Class: QueryAssociationColumn
- Inherits:
-
QueryColumn
- Object
- QueryColumn
- QueryAssociationColumn
- Defined in:
- app/models/query.rb
Instance Attribute Summary
Attributes inherited from QueryColumn
#default_order, #groupable, #name, #sortable, #totalable
Instance Method Summary collapse
- #css_classes ⇒ Object
-
#initialize(association, attribute, options = {}) ⇒ QueryAssociationColumn
constructor
A new instance of QueryAssociationColumn.
- #value_object(object) ⇒ Object
Methods inherited from QueryColumn
#caption, #frozen?, #group_by_statement, #group_value, #groupable?, #inline?, #sortable?, #value
Methods included from Redmine::I18n
#abbr_day_name, #current_language, #day_letter, #day_name, #find_language, #format_date, #format_hours, #format_time, included, #l, #l_hours, #l_hours_short, #l_or_humanize, #languages_options, #ll, #lu, #month_name, #normalize_float, #set_language_if_valid, #valid_languages
Constructor Details
#initialize(association, attribute, options = {}) ⇒ QueryAssociationColumn
Returns a new instance of QueryAssociationColumn.
116 117 118 119 120 121 |
# File 'app/models/query.rb', line 116 def initialize(association, attribute, ={}) @association = association @attribute = attribute name_with_assoc = :"#{association}.#{attribute}" super(name_with_assoc, ) end |
Instance Method Details
#css_classes ⇒ Object
130 131 132 |
# File 'app/models/query.rb', line 130 def css_classes @css_classes ||= "#{@association}-#{@attribute}" end |
#value_object(object) ⇒ Object
123 124 125 126 127 128 |
# File 'app/models/query.rb', line 123 def value_object(object) assoc = object.send(@association) if assoc && assoc.visible? assoc.send @attribute end end |