Class: QueryAssociationColumn

Inherits:
QueryColumn show all
Defined in:
app/models/query.rb

Instance Attribute Summary

Attributes inherited from QueryColumn

#default_order, #groupable, #name, #sortable, #totalable

Instance Method Summary collapse

Methods inherited from QueryColumn

#caption, #frozen?, #group_by_statement, #group_value, #groupable?, #inline?, #sortable?, #value

Methods included from Redmine::I18n

#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, #set_language_if_valid, #valid_languages

Constructor Details

#initialize(association, attribute, options = {}) ⇒ QueryAssociationColumn

Returns a new instance of QueryAssociationColumn.



108
109
110
111
112
113
# File 'app/models/query.rb', line 108

def initialize(association, attribute, options={})
  @association = association
  @attribute = attribute
  name_with_assoc = "#{association}.#{attribute}".to_sym
  super(name_with_assoc, options)
end

Instance Method Details

#css_classesObject



121
122
123
# File 'app/models/query.rb', line 121

def css_classes
  @css_classes ||= "#{@association}-#{@attribute}"
end

#value_object(object) ⇒ Object



115
116
117
118
119
# File 'app/models/query.rb', line 115

def value_object(object)
  if assoc = object.send(@association)
    assoc.send @attribute
  end
end