Sha256: 78349721d3554b3569c93a1955da3e2c3664413387ba91ee6786dc881102dde3

Contents?: true

Size: 802 Bytes

Versions: 28

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::ParticipantXlsxDecorator < Tramway::Export::Xlsx::ApplicationDecorator
  class << self
    def columns
      %i[full_name email phone organization event].map do |attribute|
        { Tramway::Event::Participant.human_attribute_name(attribute).to_sym => attribute }
      end
    end

    def filename
      'participants.xlsx'
    end
  end

  def full_name
    "#{object.values['Фамилия'] || object.values['Фамилия ']} #{object.values['Имя'] || object.values['Имя ']}"
  end

  def email
    object.values['Email']
  end

  def phone
    object.values['Телефон']
  end

  def organization
    object.values['Место работы/ Учебное заведение']
  end

  def event
    object.event.title
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
tramway-event-1.9.20 app/decorators/tramway/event/participant_xlsx_decorator.rb
tramway-event-1.9.19.8 app/decorators/tramway/event/participant_xlsx_decorator.rb
tramway-event-1.9.19.7 app/decorators/tramway/event/participant_xlsx_decorator.rb
tramway-event-1.9.19.6 app/decorators/tramway/event/participant_xlsx_decorator.rb
tramway-event-1.9.19.5 app/decorators/tramway/event/participant_xlsx_decorator.rb
tramway-event-1.9.19.4 app/decorators/tramway/event/participant_xlsx_decorator.rb
tramway-event-1.9.19.3 app/decorators/tramway/event/participant_xlsx_decorator.rb
tramway-event-1.9.19.2 app/decorators/tramway/event/participant_xlsx_decorator.rb