Method: AdminAssistant::Column::View#string

Defined in:
lib/admin_assistant/column.rb

#string(record) ⇒ Object



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/admin_assistant/column.rb', line 385

def string(record)
  string_method = "#{@column.name}_string"
  if @action_view.respond_to?(string_method)
    @action_view.send string_method, record
  else
    value = value(record)
    if @boolean_labels
      value ? @boolean_labels.first : @boolean_labels.last
    elsif value.respond_to?(:strftime) && @strftime_format
      value.strftime @strftime_format
    else
      value.to_s
    end
  end
end