Class: Tramway::Event::ParticipantXlsDecorator
- Inherits:
-
Tramway::Export::Xls::ApplicationDecorator
- Object
- Tramway::Export::Xls::ApplicationDecorator
- Tramway::Event::ParticipantXlsDecorator
- Defined in:
- app/decorators/tramway/event/participant_xls_decorator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.columns ⇒ Object
5 6 7 8 9 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 5 def columns %i[event].map do |attribute| { Tramway::Event::Participant.human_attribute_name(attribute).to_sym => attribute } end end |
.filename ⇒ Object
11 12 13 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 11 def filename 'participants.xls' end |
Instance Method Details
#event ⇒ Object
18 19 20 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 18 def event object.event.title end |
#flexible_columns ⇒ Object
22 23 24 25 26 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 22 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 |