Sha256: 92af50ed50cbfcc53f998b2fbb1c9472b2ba873fdaaad86fe2a6702e0273d311
Contents?: true
Size: 660 Bytes
Versions: 11
Compression:
Stored size: 660 Bytes
Contents
# frozen_string_literal: true class Tramway::Event::ParticipantXlsDecorator < Tramway::Export::Xls::ApplicationDecorator class << self def columns %i[event].map do |attribute| { Tramway::Event::Participant.human_attribute_name(attribute).to_sym => attribute } end end def filename 'participants.xls' end end delegate :values, to: :object def event object.event.title end def flexible_columns object.event.participant_form_fields.order(position: :asc).map(&:title).map do |key| { Tramway::Event::Participant.human_attribute_name(key).to_sym => -> { values&.dig(key) } } end end end
Version data entries
11 entries across 11 versions & 1 rubygems